Solved

Get Computer Name in VB.net?

Posted on 2004-10-20
2
2,423 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EF5: Question about Metadata Artifact Processing 4 15
Help with error when uploading excel file 3 28
Disable extension 8 38
vb.net 1 month apart 11 30
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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