GetNapaId
WindowsIdentity current = WindowsIdentity.GetCurrent();
string s = "SwdWScxS" + Environment.UserDomainName + current.User.AccountDomainSid;
SHA256 sha = new SHA256CryptoServiceProvider();
byte[] bytes = new UTF8Encoding().GetBytes(s);
sha.ComputeHash(bytes);
string str2 = Convert.ToBase64String(sha.Hash).Substring(0, 11).Replace("/", "A").Replace("+", "B");
return ("o" + str2);
} |