SVN r943
SVN-Revision: r943
This commit is contained in:
@@ -15,6 +15,8 @@ using System.Web;
|
||||
using System.Runtime.InteropServices;
|
||||
using Lskj.Control.EncryptByPrivateKey;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
using Lskj.Web.Core.Util;
|
||||
|
||||
namespace Lskj.PubBrowerXP
|
||||
{
|
||||
@@ -118,36 +120,4 @@ namespace Lskj.PubBrowerXP
|
||||
WaitForm.HideForm();
|
||||
}
|
||||
#region 内存回收
|
||||
[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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
[DllImport("kernel3
|
||||
@@ -43,6 +43,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.BonusSkins.v15.2" />
|
||||
<Reference Include="DevExpress.Data.v15.2" />
|
||||
<Reference Include="DevExpress.Pdf.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Printing.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v15.2" />
|
||||
<Reference Include="DevExpress.Sparkline.v15.2.Core" />
|
||||
@@ -50,6 +51,7 @@
|
||||
<Reference Include="DevExpress.XtraEditors.v15.2" />
|
||||
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraScheduler.v15.2.Reporting.Extensions, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraScheduler.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraScheduler.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
@@ -61,6 +63,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Debug\Lskj.Interface.Api.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lskj.Web.Core, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Lskj.Web.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MiniBlink, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\MiniBlink.dll</HintPath>
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Web;
|
||||
using System.Threading;
|
||||
using Lskj.MiniBlink;
|
||||
using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
|
||||
namespace Lskj.PubBrowerXP
|
||||
{
|
||||
@@ -35,6 +36,7 @@ namespace Lskj.PubBrowerXP
|
||||
InitializeComponent();
|
||||
blinkBrowser1 = new BlinkBrowser();
|
||||
blinkBrowser1.GlobalObjectJs = this;
|
||||
blinkBrowser1.OnCreateViewEvent += OnCreateViewEvent;
|
||||
mb = blinkBrowser1;
|
||||
blinkBrowser1.Dock = DockStyle.Fill;
|
||||
Neghte(url);
|
||||
@@ -42,30 +44,78 @@ namespace Lskj.PubBrowerXP
|
||||
blinkBrowser1.KeyDown += PreviewFrm_KeyDown;
|
||||
}
|
||||
|
||||
private IntPtr OnCreateViewEvent(IntPtr webView, IntPtr param, wkeNavigationType navigationType, string url)
|
||||
{
|
||||
previewFrm previewFrm = new previewFrm();
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
using (BaseForm form = new BaseForm())
|
||||
{
|
||||
previewFrm.LoadUrl(url);
|
||||
form.Text = url;
|
||||
form.Size = previewFrm.Size;
|
||||
previewFrm.Dock = DockStyle.Fill;
|
||||
form.Controls.Add(previewFrm);
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
return webView;
|
||||
}
|
||||
|
||||
private void PreviewFrm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyValue == 113) //点击F2 把当前网站添加到剪切板
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ERPInfo.Instance.UserName.Equals("管理员"))
|
||||
if (ERPInfo.Instance.UserName.Equals("管理员"))
|
||||
{
|
||||
//弹出当前网址
|
||||
string NUrl = this.url;
|
||||
MessageBox.Show(string.Format("Url:{0}已复制到粘贴板", NUrl));
|
||||
System.Windows.Forms.Clipboard.SetText(NUrl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
else if (e.KeyValue == 116)
|
||||
{
|
||||
try
|
||||
{
|
||||
Lskj.MiniBlink.BlinkBrowserPInvoke.wkeReload(this.blinkBrowser1.handle);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "刷新错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else if (e.Control)
|
||||
{
|
||||
float zoom = Lskj.MiniBlink.BlinkBrowserPInvoke.wkeGetZoomFactor(this.blinkBrowser1.handle);
|
||||
if (e.KeyCode == Keys.Up) // 检查是否按下上箭头
|
||||
{
|
||||
if (zoom <= 3)
|
||||
{
|
||||
Lskj.MiniBlink.BlinkBrowserPInvoke.wkeSetZoomFactor(this.blinkBrowser1.handle, zoom + 0.1f);
|
||||
}
|
||||
}
|
||||
else if (e.KeyCode == Keys.Down) // 检查是否按下下箭头
|
||||
{
|
||||
if (zoom >= 0)
|
||||
{
|
||||
Lskj.MiniBlink.BlinkBrowserPInvoke.wkeSetZoomFactor(this.blinkBrowser1.handle, zoom - 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadUrl(string url)
|
||||
{
|
||||
url = HttpHelper.ToEnUrl(url);
|
||||
this.url = url;
|
||||
blinkBrowser1.Url = url;
|
||||
}
|
||||
@@ -78,6 +128,7 @@ namespace Lskj.PubBrowerXP
|
||||
blinkBrowser1.DocumentReadyCallback += BlinkBrowser1_DocumentReadyCallback;
|
||||
blinkBrowser1.OnDownloadFile += BlinkBrowser1_OnDownloadFile;
|
||||
|
||||
url = HttpHelper.ToEnUrl(url);
|
||||
this.url = url;
|
||||
blinkBrowser1.Url = url;
|
||||
// blinkBrowser1.Focus();
|
||||
@@ -140,7 +191,7 @@ namespace Lskj.PubBrowerXP
|
||||
FrmSelectDownload frmSelectDownload = new FrmSelectDownload();
|
||||
frmSelectDownload.URL = URL;
|
||||
frmSelectDownload.FileName = FileName;
|
||||
|
||||
|
||||
frmSelectDownload.Show();
|
||||
//SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
//saveFileDialog.FileName = FileName;
|
||||
@@ -164,43 +215,4 @@ 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)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
Reference in New Issue
Block a user