Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 4

tng nh sau:

- Khi mt my no ci phn mm ca bn, th my cn gi cho bn mt


m Request Activate Code
- Da vo Request Active Code cung cp th bn s to mt license cho
my import vo phn mm th mi s dng phn mm c.

Cc bc lm nh sau:

- u tin bn ly series ca cng ca my ang ci phn mm bng string


output1 = ExecuteCommandSync("vol");
- sau bn m ha chui output1 bng phng php MD5: string output2
=ConvertStringToSecureCode(output1);
- nh vy chui output2 l Request Activate Code.

by gi to license cho Request Active Code va thu c trn:

- bn ly output2 ni thm vi mt chui b mt do bn t ra: output2


=output2 +"chui b mt";
- sau em cui output2 m ha bng MD5: string licensecode =
ConvertStringToSecureCode(output2);

xong ri, bn em licensecode ny import vo phn mm ca my ang chy


l xong. Cc hm code mnh bn di cho cc bn tham kho.

public static string ConvertStringToSecureCode(string Input1)


{
MD5 Secu1 = MD5.Create();

byte[] data1 =
Secu1.ComputeHash(Encoding.Default.GetBytes(Input1));
StringBuilder sbd = new StringBuilder();
for (int i = 0; i <= data1.Length - 1; i++)
{
sbd.Append(data1[i].ToString("x2"));
}
return sbd.ToString();
}

public static string GetRequestLicenseCode()


{
string Hd1 = HardDiskSeriesNumber();
string Code1 =ConvertStringToSecureCode(temp1);
string Code2 = Code1.Substring(24).ToUpper();
string s5 = FormatLicenseCode(Code2);
return s5;
}

private static string HardDiskSeriesNumber()


{
string output = ExecuteCommandSync("vol");
string aa = output.Split('.')[output.Split('.').Length - 1];
string bb = aa.Split(' ')[aa.Split(' ').Length - 1];
return bb.ToString().ToUpper();
}

public static string ExecuteCommandSync(object command)


{
try
{
// create the ProcessStartInfo using "cmd" as the program to be
run,
// and "/c " as the parameters.
// Incidentally, /c tells cmd that we want it to execute the command
that follows,
// and then exit.
System.Diagnostics.ProcessStartInfo procStartInfo = new
System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);

// The following commands are needed to redirect the standard


output.
// This means that it will be redirected to the
Process.StandardOutput StreamReader.
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
// Do not create the black window.
procStartInfo.CreateNoWindow = true;
// Now we create a process, assign its ProcessStartInfo and start it
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
// Get the output into a string
string result = proc.StandardOutput.ReadToEnd();

// Display the command output.


return result;
}
catch (Exception)
{
// Log the exception
return null;
}
}

You might also like