添加项目文件。
This commit is contained in:
44
KGdev.BI3D.Revit/Implementations/DefaultMuidProvider.cs
Normal file
44
KGdev.BI3D.Revit/Implementations/DefaultMuidProvider.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using KGdev.BI3D.Revit.Common;
|
||||
|
||||
namespace KGdev.BI3D.Revit.Implementations
|
||||
{
|
||||
internal class DefaultMuidProvider : IMuidProvider
|
||||
{
|
||||
public string GetMuid()
|
||||
{
|
||||
string text = "wmic";
|
||||
bool flag = File.Exists("C:\\Windows\\System32\\wbem\\WMIC.exe");
|
||||
if (flag)
|
||||
{
|
||||
text = "C:\\Windows\\System32\\wbem\\WMIC.exe";
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag2 = File.Exists("C:\\Windows\\System32\\WMIC.exe");
|
||||
if (flag2)
|
||||
{
|
||||
text = "C:\\Windows\\System32\\WMIC.exe";
|
||||
}
|
||||
}
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = text,
|
||||
Arguments = "path win32_computersystemproduct get uuid /Value",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
string text2 = process.StandardOutput.ReadToEnd();
|
||||
process.WaitForExit();
|
||||
return text2.Trim().Split(new char[] { '=' }).Last<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user