我知道我可以模拟Windows帐户使用: http://msdn.microsoft.com/en-us/library/chf6fbt4.aspx如何模仿WellKnownSidType?
但是我怎么去冒充WellKnownSidType
帐户?
SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null);
NTAccount account = sid.Translate(typeof(NTAccount)) as NTAccount;
if (account != null)
{
//Impersonate here???
}
试试吧。如果它不起作用,请回来。 – 2010-09-10 04:54:48
@Steven尝试什么? – 2010-09-10 04:59:22
我已经添加了更多明确的指示作为答案。 – 2010-09-10 21:19:24