private void StartScanThread(object text) { List<string> IPList = IP.GetLanIPs((string)text); toscanIPcount = IPList.Count; scannedIPcount = 0; foreach (string ip in IPList) { Thread T = new Thread(ScanThread); T.Start(ip); threadCount++; while (threadCount > Globals.ScanThreads) { //Keep thread alive in release builds, y needed tho???? SendBackData(""); Thread.Sleep(100); } } }
private void ScanThread(object ipString) { string ip = (string)ipString; IP ipobj = new IP(); ipobj.ScanIP(ip, ScannedItemCallback); }