Solved

How do I get hold of the computername in ASP.NET , VB.NET

Posted on 2009-07-14
5
882 Views
Last Modified: 2012-05-07
Hi  I currently have a form that users fill in I am able to grab their Windows Login Username: by using User.Identity.Name.ToString() but I would like to also grab their Computername ( I have tried using Return Environ("COMPUTERNAME").ToString ) but this returns the server/computer name of where the form is hosting from and not the name of the computer submitting the form? I am able to get the IP address by using Request.ServerVariables("REMOTE_ADDR").ToString.

But any ideas for retrieving the computer name of the person submitting the form? What is the best and simplist way of achieve this please. Thanks in advance.
0
Comment
Question by:adypips
  • 2
  • 2
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24850188
Because the ASP.NET code executes on the server, it would retrieve the server name. To retrieve the name of the client computer, you have to use JavaScript or VBScript. These links might be useful

http://bytes.com/groups/javascript/92507-get-computer-name

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22975803.html#20350353

http://lists.evolt.org/pipermail/javascript/2002-March/003113.html

0
 
LVL 12

Expert Comment

by:wht1986
ID: 24851970
REMOTE_ADDR will usually return the ip address, unless reverse DNS is enabled.  Check this link
http://support.microsoft.com/kb/297795
0
 

Author Comment

by:adypips
ID: 24853016
Hi thanks for the above comments, but they dont help me as I am not a Javascript coder, could you please provide a simple script in vbscript or javascript or asp.net script that will return the client computer name to a textbox for example  - as this would solve my problem, is there are way of doing this?

2nd comment, I can return the IP for the client no problem, really want the client computername, but thanks.

Thanks AdyPips.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 24857543
Further research suggests that its not possible unless you use some activex or other component. Here is a link to a good source of general scripts though.

http://javascript.internet.com/user-details/
0
 

Author Comment

by:adypips
ID: 24860020
thanks codecruiser I will have a look at these.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question