Get the host IP Address!!!

huangxiangcai_old

Новичок
Регистрация
23.03.2013
Сообщения
25
Реакции
4
Баллы
3
Dear friend...
i want to get the local ip address in zennopostr c# marcros
but the following commands unable to work in zenno.

Page.Request.UserHostAddress

how we can change to be vaild??
 
C#:
Развернуть Свернуть Копировать
string str="";

System.Net.Dns.GetHostName();

IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(str);

IPAddress[] addr = ipEntry.AddressList;

string IP="Your Ip Address Is :->"+ addr[addr.Length - 1].ToString();
return IP;
 
  • Спасибо
Реакции: DevOps и rostonix
very nice my friend! Appreciate with your help1:D
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)