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.
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
Code:
SessionName = Environment.GetEnvironmentVariable("SESSIONNAME")
Auguy
Northwest Ohio