Solved

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

Posted on 2009-07-14
5
891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query in AngularJS 8 45
How to force output to ascii 2 35
.NET - find out if application is running on Windows 2012 server 3 34
vb.net datagrid point 4 21
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…

756 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