How to retrieve the client system name using c# in asp,net application.
Retrieving client system name using c# in asp.net aplication
Collapse
X
-
Tags: None
-
I don't think you can get the client's system name. If so, it would probably require the use of one of the HttpRequest Members. You can get some similar information using the .LoginUserIdent ity property, such as the current client's user name..
joedeene -
try this
Also look intoCode:using System.Net; //IPAddress ip = new IPAddress(); IPHostEntry host = Dns.GetHostEntry("209.85.153.104"); //GetHostEntry("www.google.com"); //GetHostEntry("192..."); Console.WriteLine(host.HostName.ToString()); IPAddress[] aa = host.AddressList; Console.WriteLine(aa[0].ToString());
HttpRequest Class
the Request class has 2 properties u may be interested in :
UserHostName
UserHostAddressComment
-
Although Dns.GetHostByAd dress is obsolete .. you could try that too...Also
Dns.GetHostEntr y().. doesnt seems to correctly with IPAddress ...
Compare n see ...
Code:IPHostEntry host = Dns.GetHostEntry(IPAddress.Parse("192..."));// //GetHostEntry("192..."); IPHostEntry my = Dns.GetHostByAddress("192..."); Console.WriteLine(host.HostName.ToString()); IPAddress[] aa = host.AddressList; Console.WriteLine(aa[0].ToString());Comment
Comment