|
|
Hi there
Im a uni student, is there a way to get the computer name in a web page. Im developing a computer fault form. So when the user clicks the particular link it has to get that local machine's name and email to the administrator. Its my uni project. I would really appreciate if someone could help me!
|
|
|
|
|
|
|
|
if you're using ASP.Net maybe you can try code below :-
Dim host As System.Net.IPHostEntry
host = System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST"))
strComputerName = host.HostName
|
|
|
|
|
|
users computer name = System.Net.Dns.GetHostName
I'm 14 and I knew that. Wow
|
|
|
|
You will find that if you put that code into your development box and run it, it will work. BUT...(big BUT)...run that from a separate web server and hit it using any box you will find that you get the same value - the name of the web server. Yes, you will get a computer name, but you are getting the name of the host - the server. In development, you are the server - so you are getting the computer name you expect. In production - it will be different.
You are 14 and so much farther along than most of us at that age, but make sure you not only do things on your own computer, but put them in an environment that is going to emulate a production environment. Things ALWAYS work a little differently in those situations - hang in there!
|
|
|