Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. IPAddress ip = null;
  2. IPAddress mask = null;
  3. //++**********************************
  4. // Get IP
  5. //--**********************************
  6. strHostName = Dns.GetHostName();
  7. IPHostEntry iphe = Dns.GetHostEntry(strHostName);
  8. foreach (IPAddress ipheal in iphe.AddressList)
  9. {
  10. if (ipheal.AddressFamily ==AddressFamily.InterNetwork)
  11. {
  12. ip = ipheal;
  13. break;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement