提交当前本机整理版本
This commit is contained in:
@@ -120,4 +120,31 @@ namespace Lskj.PubBrowerXP
|
||||
WaitForm.HideForm();
|
||||
}
|
||||
#region 内存回收
|
||||
[DllImport("kernel3
|
||||
[DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
|
||||
public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize);
|
||||
/// <summary>
|
||||
/// <para>说明:释放内存</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2021-09-29 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public static void ClearMemory()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
//FrmMian为我窗体的类名
|
||||
FrmMain.SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -215,4 +215,41 @@ namespace Lskj.PubBrowerXP
|
||||
//public static async void DOTaskWithAsync(string str)
|
||||
//{
|
||||
// await Task.Run(() =>
|
||||
//
|
||||
// {
|
||||
// Dotaskfunction(str);
|
||||
// });
|
||||
//}
|
||||
public static void Dotaskfunction(string s)
|
||||
{
|
||||
Thread.Sleep(1000 * 5);
|
||||
if (mb != null)
|
||||
{
|
||||
mb.Invoke(new Action<string>(
|
||||
(sx) =>
|
||||
{
|
||||
string _str = "ceshi" + sx;
|
||||
_str = System.Web.HttpUtility.UrlEncode(_str);
|
||||
string invokeJSStr = "asyncTest('" + _str + "')";
|
||||
mb.InvokeJS(invokeJSStr);
|
||||
}
|
||||
), s);
|
||||
}
|
||||
|
||||
}
|
||||
private void BlinkBrowser1_DocumentReadyCallback()
|
||||
{
|
||||
}
|
||||
|
||||
private void BlinkBrowser1_OnTitleChangeCall(string title)
|
||||
{
|
||||
Text = title;
|
||||
}
|
||||
|
||||
private void BlinkBrowser1_OnUrlChange2Call(string url)
|
||||
{
|
||||
url = HttpHelper.ToEnUrl(url);
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user