System.Security.Principal.WindowsIdentity.WindowsIdentity.WindowsIdentity.GetAnonymous C# (CSharp) Method

GetAnonymous() public static method

public static GetAnonymous ( ) : System.Security.Principal.WindowsIdentity
return System.Security.Principal.WindowsIdentity
		public static WindowsIdentity GetAnonymous ()
		{
			WindowsIdentity id = null;
			if (IsPosix) {
				id = new WindowsIdentity ("nobody");
				// special case
				id._account = WindowsAccountType.Anonymous;
				id._authenticated = false;
				id._type = String.Empty;
			}
			else {
				id = new WindowsIdentity (IntPtr.Zero, String.Empty, WindowsAccountType.Anonymous, false);
				// special case (don't try to resolve the name)
				id._name = String.Empty;
			}
			return id;
		}