How to get a Unique ID for the current user's logon session in windows - c#

后端 未结 4 1450
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-10 18:05

I need to get a value that uniquely identifies the current windows user\'s logon session. This is for a winforms app, not ASP.NET. I\'ll be retrieving this from within multi

4条回答
  •  有刺的猬
    2020-12-10 18:55

    You can try Environment.UserDomainName & Environment.UserName

    To ensure a unique id for each user session I guess you'll have to use the painful method you mentioned - How to get the logon SID in C#.

提交回复
热议问题