旺旺和支付宝控件所获取到的本机硬件信息
时间:2025-04-05
时间:2025-04-05
旺旺和支付宝控件所获取到的本机硬件信息
The pretender独家出品
从我们最简单的分析 在客户端上安装阿里旺旺或者直接安装ActiveX完全能够很清晰的看到用户的本机信息。 首先在客户端上安装旺旺 一般手法是建立一个权限 简称健权 然后我这边是简单调用C语言 下面这个是我本人写的一些代码 可以调用出很多信息 你们可以参考下 如果代码看不懂得话 直接看我上面的标题 Ps 阿里工程师很强大 远比我复杂
操作系统的登录用户名
string GetUserName()
{
try
{
string st = "";
ManagementClass mc = new ManagementClass("Win32_ComputerSystem"); ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
st = mo["UserName"].ToString();
}
moc = null;
mc = null;
return st;
}
catch
{ return "unknow";
}
finally
{ }
}
获取MAC地址
string GetMacAddress()
{
try
{
//获取网卡硬件地址
旺旺和支付宝控件所获取到的本机硬件信息
string mac = "";
ManagementClass mc = new
ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if ((bool)mo["IPEnabled"] == true)
{
mac = mo["MacAddress"].ToString();
break;
}
}
moc = null;
mc = null;
return mac;
}
catch
{
return "unknow";
}
finally
{ } }
获取IP地址
/// <summary>
/// 获取客户端内网IP地址
/// </summary>
/// <returns></returns>
private static string getClientLocalIPAddress()
{
string localIP=null;
try
{
IPHostEntry ipHost =
http://.Dns.GetHostEntry(Dns.GetHostName());//
Dns.Resolve(Dns.GetHostName()); ;
IPAddress ipaddress = ipHost.AddressList[0];
localIP = ipaddress.ToString();
旺旺和支付宝控件所获取到的本机硬件信息
return "内网IP地址:"+localIP;
}
catch
{
return "内网IP地址:unknown";
}
finally
{ }
}
/// <summary>
/// 获得客户端外网IP地址
/// </summary>
/// <returns>IP地址</returns>
public static string getClientInternetIPAddress()
{
string internetAddress = "";
try
{
using (WebClient webClient = new WebClient())
{
internetAddress =
webClient.DownloadString("http:///ip");//从外部网页获得IP地址 //判断IP是否合法
if
(!System.Text.RegularExpressions.Regex.IsMatch(internetAddress, "[0-
9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"))
{
internetAddress =
webClient.DownloadString("http:///ipaddress");//从腾讯提供的API中获得IP地址
}
}
return "外网IP地址:" + internetAddress;
}
catch
{
return "外网IP地址:unknown";
}
旺旺和支付宝控件所获取到的本机硬件信息
finally
{ } }
获取硬盘ID
string GetDiskID()
{
try
{
String HDid = "";
ManagementClass mc = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
//HDid = (string)mo.Properties["Model"].ToString();
HDid = (String)mo.Properties["Model"].Value.ToString();
}
moc = null;
mc = null;
return HDid;
}
catch
{
return "unknow";
}
finally
{ } }
获取CPUid
string GetCpuID()
{
try
{
//获取CPU序列号代码
string cpuInfo = "";//cpu序列号
ManagementClass mc = new ManagementClass("Win32_Processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
旺旺和支付宝控件所获取到的本机硬件信息
cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
}
moc = null;
mc = null;
return cpuInfo;
}
catch
{
return "unknow";
}
finally
{ } }
系统名称
string GetSystemType()
{
try
{
string st = "";
ManagementClass mc = new ManagementClass("Win32_ComputerSystem"); ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
st = mo["SystemType"].ToString();
}
moc = null;
mc = null;
return st;
}
catch
{
return "unknow";
}
finally
{ } }
获取物理内存
string GetTotalPhysicalMemory()
旺旺和支付宝控件所获取到的本机硬件信息
{
try
{
string st = "";
ManagementClass mc = new ManagementClass("Win32_ComputerSystem"); ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
st = mo["TotalPhysicalMemory"].ToString();
}
moc = null;
mc = null;
return st;
}
catch
{
return "unknow";
}
finally
{ }
}
这段代码 直接挖到心脏处
BIOS 编号,支持 AMI, AWARD, …… 此处隐藏:3182字,全部文档内容请下载后查看。喜欢就下载吧 ……