Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environment.GetEnvironmentVariable("SESSIONNAME") Fails

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I am using the following code to obtain the session name and I am using it to determine if the program is being run locally or through RDP.
Code:
SessionName = Environment.GetEnvironmentVariable("SESSIONNAME")
This has worked for over a year and still works on all but one of the computers. All of a sudden this code is throwing an "Object reference not set to an instance of an object". I un-installed the application and the .net framework and re-installed both. This appeared to solve the problem, but after signing off and on a few times it failed again. I don't know if this is a VB.net problem or not but thought someone may have some ideas as to what might cause this behavior. By the way I can use the GetEnvironmentVariable to get other info like the computer name with no problem.

Auguy
Northwest Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top