Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3.  
  4. IPHostEntry host = null;
  5.  
  6. host = Dns.GetHostEntry(entered_ip);
  7.  
  8. foreach (IPAddress address in host.AddressList)
  9. {
  10.  
  11. IPEndPoint ipe = new IPEndPoint(address, 7779);
  12. Socket samp = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
  13.  
  14. samp.Connect(ipe);
  15.  
  16. if (samp.Connected)
  17. {
  18. enable_anticheat();
  19.  
  20. Process.Start("samp://" + entered_ip + ":" + entered_port);
  21. break;
  22. }
  23. else
  24. {
  25. continue;
  26. }
  27. }
  28. }
  29.  
  30. private void Form1_FormClosing(object sender, FormClosingEventArgs e)
  31. {
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement