Solved

Get Computer Name in VB.net?

Posted on 2004-10-20
2
2,409 Views
Last Modified: 2011-11-16
How to get the computer name in VB.net?
0
Comment
Question by:tgatif
2 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 12360918
If you just need Name of the Currently logged on user there are few easy option like following:
- Environment.UserName
- environment variable |USERNAME| using the Environment.GetEnvironmentVariable method
- SystemInformation.UserName

-----------------------

And if it it's a ASP.Net application then do following to get the UserName
  - Disable Annonymous Access (from IIS)
  - Turn on Windows Authentication (in Web.Config)  (<authentication mode="Windows" />)
  - Use 'User.Identity.Name' or Request.ServerVariables("LOGON_USER") or Request.ServerVariables("REMOTE_USER") to retrive Username

-tushar
0
 
LVL 7

Accepted Solution

by:
LandyJ earned 250 total points
ID: 12361588
Dim MyName As String = System.Windows.Forms.SystemInformation.ComputerName
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now