void LoadAgentSettings(DataTable dt) { string prefix = "/Agent/"; string ip = DataTable_Functions.GetTableValue(dt, "address", prefix + "Address", "value"); string p = DataTable_Functions.GetTableValue(dt, "address", prefix + "Port", "value"); string devicename = DataTable_Functions.GetTableValue(dt, "address", prefix + "DeviceName", "value"); string proxyAddress = devicename = DataTable_Functions.GetTableValue(dt, "address", prefix + "ProxyAddress", "value"); string proxyPort = devicename = DataTable_Functions.GetTableValue(dt, "address", prefix + "ProxyPort", "value"); int port; int.TryParse(p, out port); // Proxy Settings MTConnect.HTTP.ProxySettings proxy = null; if (proxyPort != null) { int proxy_p = -1; if (int.TryParse(proxyPort, out proxy_p)) { proxy = new MTConnect.HTTP.ProxySettings(); proxy.Address = proxyAddress; proxy.Port = proxy_p; } } RunProbe(ip, proxy, port, devicename); }
void RunProbe(string address, MTConnect.HTTP.ProxySettings proxy, int port, string deviceName) { var info = new Probe_Info(); info.address = address; info.port = port; info.deviceName = deviceName; info.proxy = proxy; ThreadPool.QueueUserWorkItem(new WaitCallback(RunProbe_Worker), info); }