Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#如何识别客人账户?_C#_User Accounts - Fatal编程技术网

C#如何识别客人账户?

C#如何识别客人账户?,c#,user-accounts,C#,User Accounts,在我的c#winForm应用程序中,我必须识别是否有来宾帐户正在运行该应用程序。 有什么想法吗?您可以检查当前的WindowsIdentity的属性: if (System.Security.Principal.WindowsIdentity.GetCurrent().IsGuest) { // it's a guest account }

在我的c#winForm应用程序中,我必须识别是否有来宾帐户正在运行该应用程序。 有什么想法吗?

您可以检查当前的
WindowsIdentity
的属性:

if (System.Security.Principal.WindowsIdentity.GetCurrent().IsGuest)
{
    // it's a guest account
}