Click here to Skip to main content
11,928,078 members (29,082 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
Dear all,

i want to store clent computer name or any other key in database..
how to get.

below code work in local computer fine but on server it get server details.

Response.Write("Owner: " & Request.LogonUserIdentity.Owner.ToString() & "<BR>")
Response.Write("Your Computer Name: " + System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName + "<BR>")
Posted 25-Jan-13 1:22am
aspnet_regiis -i 25-Jan-13 6:25am
Not possible.. Getting client's computer name is sheer violation of privacy policy... Its like asking for your email password.. Will you give it if someone asks you?
DINESH K MAURYA 25-Jan-13 6:34am
can be get any information to client which is uniqe.
i want to give permission to specific computer to login the application.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can use following piece of code and see if it helps

string[] hostEntries = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
txtECN.Text = hostEntries [0].ToString();

However, not sure how it will behave in case the user is "behind" firewall/proxy.

Hope that helps

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100