软件使用微软系统的唯一ID绑定指定电脑
class Program
{
static void Main(string[] args)
{
string sysId = "";
Process da = new Process();
da.StartInfo.FileName = "cmd.exe";
da.StartInfo.Arguments = "/k cscript %WINDIR%\\SYSTEM32\\SLMGR.VBS /DTI";
da.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动
da.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息
da.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息
da.StartInfo.RedirectStandardError = true; //重定向标准错误输出
da.StartInfo.CreateNoWindow = true; //不显示程序窗口
da.Start(); //启动程序
da.StandardInput.WriteLine("exit");
string strRst = da.StandardOutput.ReadToEnd();
string[] readLine = strRst.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
string id = readLine[].Split(':')[].Trim();
sysId = id;
Console.WriteLine(sysId);
Console.ReadKey();
}
}