public void setupConection(string ip, int port) { try { Ip = ip; //string IPString = ConfigurationManager.AppSettings["machineip"]; //int port = 0; //int.TryParse(ConfigurationManager.AppSettings["machineport"], out port); //string productLine = ConfigurationManager.AppSettings["productline"]; //netWorkServer = NetWorkServer.CreateInstance(ip, port); netWorkServer = new NetWorkServer(ip, port); NetConnectStat stu = netWorkServer.NetStat; netWorkServer.NetConnectChanged += NetWorkServer_NetConnectChanged; netWorkServer.ReciveDataEvent += NetWorkServer_ReciveDataEvent; // DisplayDataEvent += ExecuteQueue_DisplayDataEvent; } catch (Exception e) { LogClass.WriteLogFile("Class-ExecuteQueue;Fun-setupConnection; 行号67:" + e.Message); //throw; } }
private void NetWorkServer_NetConnectChanged(object sender, NetConnectArgs e) { Netstat = e.NetStat; OnNetConnectChanged(e); }
private void NetWorkServer_NetConnectChanged(object sender, NetConnectArgs e) { Netstat = e.NetStat; OnNetConnectChanged(e); //Console.WriteLine(e.NetStat.ToString() + Ip); }
public NetConnectArgs(NetConnectStat netstat) { NetStat = netstat; }