SVN-Revision: r944
This commit is contained in:
tdx
2025-08-11 08:32:57 +00:00
parent 9da39e7764
commit 5202cb5c11
2 changed files with 56 additions and 30 deletions
+51 -30
View File
@@ -16,8 +16,9 @@ using Lskj.Util;
using System.Web;
using Lskj.Business;
using Lskj.Control;
using Lskj.Web.Core.Util;
using System.Collections;
using System.Linq;
namespace Lskj.MiniBlink
{
@@ -112,10 +113,56 @@ namespace Lskj.MiniBlink
blinkBrowser1.OnDownloadFile += BlinkBrowser1_OnDownloadFile;
this.url = url;
blinkBrowser1.Url = url;
blinkBrowser1.Url = ToEnUrl(url);
// blinkBrowser1.Focus();
}
public static string ToEnUrl(string url)
{
string[] urlParams = url.Split('?');
string enKey = "encrypt", enVal = "";
bool hasEn = false;
if (urlParams.Length > 1)
{
string[] queryParams = urlParams[1].Split('&');
List<string> qpLS = new List<string>();
Hashtable pms = new Hashtable();
hasEn = queryParams.Any(str => str.Trim().StartsWith(enKey, StringComparison.OrdinalIgnoreCase));
foreach (string q in queryParams)
{
string[] eqParams = q.Split('=');
if (eqParams.Length > 1)
{
if (hasEn && eqParams[0].ToLower() == enKey)
{
enVal = eqParams[1];
continue;
}
if (hasEn || eqParams[0].ToLower() == "username" || eqParams[0].ToLower() == "password")
{
pms.Add(eqParams[0], eqParams[1]);
}
else
{
qpLS.Add(string.Format("{0}={1}", eqParams[0], HttpUtility.UrlEncode(eqParams[1])));
}
}
else
{
}
}
if (pms.Count > 0)
{
DateTime dateTime = DateTime.Now.AddDays(1);
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
pms.Add("exp", timestamp);
}
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
}
return url;
}
/// <summary>
/// winform键盘事件
/// </summary>
@@ -334,30 +381,4 @@ namespace Lskj.MiniBlink
{
var data = (wkeMemBuf)Marshal.PtrToStructure(bf, typeof(wkeMemBuf));
if (data.data != IntPtr.Zero && data.length != 0)
{
byte[] ys = new byte[data.length];
Marshal.Copy(data.data, ys, 0, ys.Length);
string fileName = Guid.NewGuid().ToString("n") + ".bmp";
System.IO.File.WriteAllBytes(fileName, ys);
MessageBox.Show("截图保存成功,图片地址为:" + Application.StartupPath + "\\" + fileName);
}
else
{
MessageBox.Show("截图失败,数据解析失败。");
}
}
else
{
MessageBox.Show("截图失败,返回空。");
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
}
}
if (data.dat
@@ -39,10 +39,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<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.Sparkline.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<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="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data.Linq" />