Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ScanPorts()
- {
- if (!(FileLocationPORTS == string.Empty))
- {
- string[] ArrayString = File.ReadAllLines(FileLocationPORTS);
- foreach (string host in ArrayString)
- {
- string s = host.Split(':')[0];
- s = host.Split(';')[0];
- foreach (int port in ListaPortowHTTP)
- {
- using (var tcp = new TcpClient())
- {
- var ar = tcp.BeginConnect(s, port, null, null);
- using (ar.AsyncWaitHandle)
- {
- if (ar.AsyncWaitHandle.WaitOne(2500, false))
- {
- try
- {
- tcp.EndConnect(ar);
- ++count;
- flatLabel4.Text = "Proxies Ports Opened: " + count;
- list_2.Add(s + ":" + port);
- File.WriteAllLines(SCANPORTSOUTPUT, list_2.Distinct().ToArray());
- }
- catch
- {
- }
- tcp.Close();
- }
- else
- {
- }
- }
- }
- count2++;
- flatLabel5.Text = "Checked PORTS : " + count2 + "/23";
- }
- flatLabel5.Text = "Checked PORTS : " + "0/23";
- count2 = 0;
- count1++;
- int numOfLines = File.ReadAllLines(FileLocationPORTS).Length;
- double xd = numOfLines / 100;
- Math.Round(xd);
- flatLabel6.Text = "Checked IPS: " + count1 + "/" + numOfLines;
- if (count1 % xd == 0)
- {
- portprogress.Value++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement