As you can see in the tab user of the windows task manager, there are 5 columns :
User ID Status Client Name Session
Mike 1 Active Console
I have used this to get the session id :
System.Diagnostics.Process.GetCurrentProcess().SessionId.ToString();
I want to know the session name to see if it is console or remote desktop or etc.
private string getsessionname()
{
// function to get session name
}
if(getsessionname=="console")
{
// do staff1
}
else
{
// do staff2
}
thanks.