|
|
@@ -5,6 +5,8 @@ using UAS_MES.DataOperate;
|
|
|
using UAS_MES.Entity;
|
|
|
using UAS_MES.PublicMethod;
|
|
|
using System.Security.Cryptography.X509Certificates;
|
|
|
+using System.Net;
|
|
|
+using System.Net.Sockets;
|
|
|
|
|
|
namespace UAS_MES
|
|
|
{
|
|
|
@@ -60,12 +62,7 @@ namespace UAS_MES
|
|
|
PassWord.Select();
|
|
|
else
|
|
|
UserName.Select();
|
|
|
- //本来static是不要实例化的,但是需要调用触发添加键值对的构造函数
|
|
|
- if (lgc == null)
|
|
|
- lgc = new LogicHandler();
|
|
|
BaseUtil.SetFormCenter(this);
|
|
|
- //try { CertImport(); }
|
|
|
- //catch (Exception) { }
|
|
|
}
|
|
|
|
|
|
//点击登陆按钮的时候
|
|
|
@@ -82,7 +79,6 @@ namespace UAS_MES
|
|
|
SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
|
|
|
SystemInf.ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;
|
|
|
SystemInf.ConnectionString = "Data Source=" + DbComboxData.Rows[i]["ma_address"] + ";User ID=" + DbComboxData.Rows[i]["ma_user"] + ";PassWord=" + DbComboxData.Rows[i]["ms_pwd"];
|
|
|
- Console.WriteLine(SystemInf.ConnectionString);
|
|
|
DataHelper.DBConnectionString = SystemInf.ConnectionString;
|
|
|
//重新执行一遍构造函数使得重置之后的链接字符串生效
|
|
|
dh = new DataHelper();
|
|
|
@@ -98,7 +94,16 @@ namespace UAS_MES
|
|
|
{
|
|
|
this.Hide();
|
|
|
SetInf();//设置User的全局变量
|
|
|
- LogManager.DoLog("登陆成功" + User.UserName +" "+User.UserAccountType);
|
|
|
+ IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName());
|
|
|
+ string IPAddress = "";
|
|
|
+ for (int i = 0; i < IpEntry.AddressList.Length; i++)
|
|
|
+ {
|
|
|
+ if (IpEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
|
|
|
+ IPAddress = IpEntry.AddressList[i].ToString();
|
|
|
+ }
|
|
|
+ string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
|
+ LogicHandler.RecordLogInfo(User.UserCode, User.UserName, version, "CS", IPAddress);
|
|
|
+ LogManager.DoLog("登陆成功" + User.UserName + " " + User.UserAccountType);
|
|
|
Main dialog = new Main();
|
|
|
dialog.ShowDialog();
|
|
|
this.Close();
|