110,533
社区成员
发帖
与我相关
我的任务
分享
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
(System.Threading.ThreadStart)delegate () {
try {
WebBrowser1.Source = new Uri(website.sendAddress);
} catch { }
});
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
(System.Threading.ThreadStart)delegate () {
try {
using(WebBrower wb1=new WebBrower()){
//WebBrowser1.Source = new Uri(website.sendAddress);
//做你要做的事,一切以wb1为操作对象,WebBrowser1仅仅是你载入和输出用。
}
} catch { }
});
// in class definition
[DllImport("KERNEL32.DLL", EntryPoint = "SetProcessWorkingSetSize", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
internal static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);
[DllImport("KERNEL32.DLL", EntryPoint = "GetCurrentProcess", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
internal static extern IntPtr GetCurrentProcess();
//code to call when you want to reduce the memory
IntPtr pHandle = GetCurrentProcess();
SetProcessWorkingSetSize(pHandle, -1, -1);