using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
using System.IO;
namespace MayaReg
{
class Program
{
static void Main(string[] args)
{
ManagementObjectSearcher sysinfo = new ManagementObjectSearcher(new SelectQuery("Win32_NetworkAdapterConfiguration"));
foreach (ManagementObject mo in sysinfo.Get())
{
if ((bool)mo["IPEnabled"])
{
String hardInfo = mo.Properties["MacAddress"].Value.ToString().ToLower();
hardInfo = hardInfo.Replace(":", "");
//Console.Write(hardInfo);
String s ="FEATURE MayaUnltd sgiawd 2009.000 permanent uncounted 0 \\\n HOSTID=111111111111";
s=s.Replace("111111111111", hardInfo);
using (StreamWriter sw = new StreamWriter("C:\\FLEXLM\\aw.dat"))
{
sw.Write(s);
}
System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
Info.FileName = "awkeygen.exe";
Info.Arguments = "aw.dat";
Info.WorkingDirectory = "C:\\FLEXLM";
System.Diagnostics.Process Proc;
try
{
Proc = System.Diagnostics.Process.Start(Info);
}
catch (System.ComponentModel.Win32Exception e)
{
Console.WriteLine("系统找不到指定的程序文件。\r{0}", e);
return;
}
}
}
Console.Write("Maya破解完成,按Enter键退出");
Console.Read();
}
}
}