Console Application Issues

Shook1s

New member
Joined
Jul 22, 2004
Messages
2
Programming Experience
Beginner
Greetings All,

I used the following in a Windows Based Application and It works fine.

Imports System.Security.Principal.WindowsPrincipal

and then used Msgbox(SystemInformation.Username) to popup the current user name. When I tried doing a console.writeline(systeminformation.username) it does not work.

Any suggestions???
 

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
Try this
VB.NET:
[size=2]Console.WriteLine(System.Environment.UserName)
It gives the current username of the system
[/size]
 

Shook1s

New member
Joined
Jul 22, 2004
Messages
2
Programming Experience
Beginner
I will give it a try ... thanks for the quick response.
 
Top Bottom