试了ManagementClass,得到很多信息,不知哪个是Computer SID。谢谢。

解决方案 »

  1.   


    下面的代码来自:http://www.eggheadcafe.com/software/aspnet/34259796/how-do-i-get-the-machine.aspx
    你还可以参考其他人对于SID的讨论。To get the machine SID in C#, you need NTAccount class and
    SecurityIdentifier class. They live in System.Security.Principal namespace.The code looks like this:NTAccount account = new NTAccount("DOMAIN", "MACHINE-NAME$");
    SecurityIdentifier sid =
    (SecurityIdentifier)account.Translate(typeof(SecurityIdentifier));// we're done, show the results:
    Console.WriteLine(account.Value);
    Console.WriteLine(sid.Value);
      

  2.   

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/64bf775c-5962-49a1-92d2-dd0868ac0e38