Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
86ae16fa94
2 files changed
+17
-19
No files matched your search
+8
-5
@@ -53,7 +53,9 @@ namespace formula_manage
|
|||||||
DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT缓存
|
DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT缓存
|
||||||
// DataTable RecipedataTable = new DataTable(); //建立Recipe缓存
|
// DataTable RecipedataTable = new DataTable(); //建立Recipe缓存
|
||||||
|
|
||||||
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
|
private readonly string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
|
||||||
|
//调用配置文件
|
||||||
|
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini");
|
||||||
|
|
||||||
string TEXT_SQLIP;
|
string TEXT_SQLIP;
|
||||||
string TEXT_SQLNAME;
|
string TEXT_SQLNAME;
|
||||||
@@ -74,7 +76,6 @@ namespace formula_manage
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Closing += Window_Closing; //添加窗口关闭事件
|
this.Closing += Window_Closing; //添加窗口关闭事件
|
||||||
|
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
|
||||||
if (Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6"))) UserClass.TCPServer.Start(); //开启网路通讯
|
if (Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6"))) UserClass.TCPServer.Start(); //开启网路通讯
|
||||||
|
|
||||||
USER.Text = App.USER_Purview;
|
USER.Text = App.USER_Purview;
|
||||||
@@ -128,7 +129,6 @@ namespace formula_manage
|
|||||||
|
|
||||||
private void PrintForms()//传入可用打印模板
|
private void PrintForms()//传入可用打印模板
|
||||||
{
|
{
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
|
||||||
int dirID=0;
|
int dirID=0;
|
||||||
|
|
||||||
DataTable Report = new DataTable();
|
DataTable Report = new DataTable();
|
||||||
@@ -159,7 +159,6 @@ namespace formula_manage
|
|||||||
|
|
||||||
private void sql_()
|
private void sql_()
|
||||||
{
|
{
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
|
|
||||||
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
|
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
|
||||||
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
|
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
|
||||||
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
|
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
|
||||||
@@ -261,7 +260,11 @@ namespace formula_manage
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UserClass.LogGing.LogGingDATA(Log_time + "HttpSERVER_STOP");
|
// UserClass.LogGing.LogGingDATA(Log_time + "HttpSERVER_STOP");
|
||||||
//if (Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6"))) UserClass.HttpSERVER.Stop(); //停止网络通信
|
if (Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6")))
|
||||||
|
{
|
||||||
|
UserClass.TCPServer.Btn_SendAll("SERVER_STOP");
|
||||||
|
}
|
||||||
|
|
||||||
UserClass.LogGing.LogGingDATA("FORMULA_STOP");
|
UserClass.LogGing.LogGingDATA("FORMULA_STOP");
|
||||||
}
|
}
|
||||||
private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能
|
private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能
|
||||||
|
|||||||
+9
-14
@@ -24,6 +24,7 @@ namespace formula_manage.UserClass
|
|||||||
//字典集合:存储IP和Socket的集合
|
//字典集合:存储IP和Socket的集合
|
||||||
public static Dictionary<string, Socket> OnLineList = new Dictionary<string, Socket>();
|
public static Dictionary<string, Socket> OnLineList = new Dictionary<string, Socket>();
|
||||||
|
|
||||||
|
DataTable IPdataTable = new DataTable(); //建立缓存
|
||||||
//当前时间
|
//当前时间
|
||||||
|
|
||||||
private string CurrentTime
|
private string CurrentTime
|
||||||
@@ -89,7 +90,9 @@ namespace formula_manage.UserClass
|
|||||||
|
|
||||||
int length = -1;
|
int length = -1;
|
||||||
try
|
try
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
length = clientSocket.Receive(buffer);
|
length = clientSocket.Receive(buffer);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
@@ -105,6 +108,7 @@ namespace formula_manage.UserClass
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
{
|
{
|
||||||
//客户端下线了
|
//客户端下线了
|
||||||
@@ -112,7 +116,6 @@ namespace formula_manage.UserClass
|
|||||||
string ip = clientSocket.RemoteEndPoint.ToString();
|
string ip = clientSocket.RemoteEndPoint.ToString();
|
||||||
UserClass.LogGing.LogGingDATA("IP_Line = " + ip);
|
UserClass.LogGing.LogGingDATA("IP_Line = " + ip);
|
||||||
// AddOnLine(ip, false);
|
// AddOnLine(ip, false);
|
||||||
|
|
||||||
OnLineList.Remove(ip);
|
OnLineList.Remove(ip);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -123,7 +126,6 @@ namespace formula_manage.UserClass
|
|||||||
infoR = econding.GetString(buffer, 0, length);
|
infoR = econding.GetString(buffer, 0, length);
|
||||||
//ShowMessage(info);
|
//ShowMessage(info);
|
||||||
string ip = clientSocket.RemoteEndPoint.ToString();
|
string ip = clientSocket.RemoteEndPoint.ToString();
|
||||||
Bn_Send(ip, infoR+"return");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,34 +171,27 @@ namespace formula_manage.UserClass
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消息发送
|
/// 消息发送
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
|
|
||||||
public static void Bn_Send(string IP ,string DAT)
|
public static void Bn_Send(string IP ,string DAT)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (OnLineList.ContainsKey(IP))
|
if (OnLineList.ContainsKey(IP))
|
||||||
{
|
{
|
||||||
OnLineList[IP].Send(econding.GetBytes(DAT));
|
OnLineList[IP].Send(econding.GetBytes(DAT));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 群发功能
|
/// 群发功能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
public static void Btn_SendAll(string DAT)
|
||||||
/// <param name="e"></param>
|
|
||||||
private void btn_SendAll_Click(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
foreach (string item in this.lst_Online.Items)
|
foreach (string item in OnLineList.Keys.ToArray())
|
||||||
{
|
{
|
||||||
if (OnLineList.ContainsKey(item))
|
if (OnLineList.ContainsKey(item))
|
||||||
{
|
{
|
||||||
OnLineList[item].Send(econding.GetBytes(this.txt_Send.Text.Trim()));
|
OnLineList[item].Send(econding.GetBytes(DAT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user