SVN r1097

SVN-Revision: r1097
This commit is contained in:
tdx
2026-01-13 08:30:50 +00:00
parent eafc73a169
commit 340bc7e227
+43 -14
View File
@@ -33,6 +33,7 @@ using System.Net;
using System.Collections; using System.Collections;
using System.Web; using System.Web;
using Lskj.Web.Core.Util; using Lskj.Web.Core.Util;
using System.Text.RegularExpressions;
namespace Lskj.Main.Model namespace Lskj.Main.Model
{ {
@@ -111,16 +112,13 @@ namespace Lskj.Main.Model
if (isStart) if (isStart)
{ {
// Delphi数据库连接检查 // Delphi数据库连接检查
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0) //if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
{ //{
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]"); // MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
SplashForm.HideForm(); // SplashForm.HideForm();
RunConfigForm(); // RunConfigForm();
return; // return;
} //}
SplashForm.HideForm(); SplashForm.HideForm();
@@ -296,15 +294,17 @@ namespace Lskj.Main.Model
{ {
//WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1); //WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1);
// WinHelper.WinExec(dllName); // WinHelper.WinExec(dllName);
string[] dllNameSplit = dllName.Split(','); string[] dllNameSplit = Regex.Split(dllName, ":args=");
if (dllNameSplit.Length > 1 && dllNameSplit[1].Equals("1"))//嵌入exe模块 string[] pmsSplit = dllNameSplit.Length > 1 ? (dllNameSplit[1] + "").Split(',') : null;
if (dllNameSplit.Length > 1 && pmsSplit != null && pmsSplit.Length > 0)//嵌入exe模块
{ {
string[] pmsArgs = pmsSplit.Select(pms => ReplaceHelper.ReplaceUserInfo(pms)).ToArray();
string guid = Guid.NewGuid().ToString(); string guid = Guid.NewGuid().ToString();
XtraTabPage tp = new XtraTabPage(); XtraTabPage tp = new XtraTabPage();
ProcessStartInfo processStartInfo = new ProcessStartInfo() ProcessStartInfo processStartInfo = new ProcessStartInfo()
{ {
FileName = dllNameSplit[0], FileName = dllNameSplit[0],
Arguments = HandleHelper.CombineArgs(args), Arguments = HandleHelper.CombineArgs(pmsArgs),
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = false, RedirectStandardOutput = false,
RedirectStandardError = false, RedirectStandardError = false,
@@ -1045,4 +1045,33 @@ namespace Lskj.Main.Model
{ {
DateTime dateTime = DateTime.Now.AddDays(1); DateTime dateTime = DateTime.Now.AddDays(1);
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); 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>
/// 退出主程序,进入登录界面
/// </summary>
public static void ReLogin()
{
if (_frmMain != null)
{
if (ERPInfo.Instance.WatermarkForm != null)
{
ERPInfo.Instance.WatermarkForm.Close();
ERPInfo.Instance.WatermarkForm.Dispose();
}
_frmMain.Close();
_frmMain.Dispose();
_frmMain = null;
}
StartForm();
}
}
}