获取电脑CPUID,HdId,MacId后,加工处理这个字符串
代码
//交换字符的位置
private string ChangCharLocation(string pcNum)
{
string hidMacId = pcNum;
char[] chars = hidMacId.ToCharArray();
char temp;
for (int i = 1; i < 4; i++)
{
int n = 2 * i - 1;
temp = chars[n];
chars[n] = chars[n + 11];
chars[n + 11] = temp;
}
string str = "";
for (int i = 0; i < chars.Length; i++)
{
str += chars[i];
}
return str;
}
//字符加个数转化成其他字符
private string GenerateRegNum(string hidMacId)
{
char[] chars = hidMacId.ToCharArray();
char temp;
for (int i = 0; i < chars.Length; i++)
{
temp = chars[i];
chars[i] = (char)((int)temp + 30);
}
string regNum = "";
for (int i = 0; i < chars.Length; i++)
{
regNum += chars[i];
}
return regNum;
}
private string ChangCharLocation(string pcNum)
{
string hidMacId = pcNum;
char[] chars = hidMacId.ToCharArray();
char temp;
for (int i = 1; i < 4; i++)
{
int n = 2 * i - 1;
temp = chars[n];
chars[n] = chars[n + 11];
chars[n + 11] = temp;
}
string str = "";
for (int i = 0; i < chars.Length; i++)
{
str += chars[i];
}
return str;
}
//字符加个数转化成其他字符
private string GenerateRegNum(string hidMacId)
{
char[] chars = hidMacId.ToCharArray();
char temp;
for (int i = 0; i < chars.Length; i++)
{
temp = chars[i];
chars[i] = (char)((int)temp + 30);
}
string regNum = "";
for (int i = 0; i < chars.Length; i++)
{
regNum += chars[i];
}
return regNum;
}