1.cpu序列号2.mac序列号3.硬盘id在给软件加序列号时这三个应该是最有用的,可以实现序列号和机器绑定,对保护软件很有好处.哈哈. using System; using System.Management; /// Computer Information public class Computer { public string CpuID; //1.cpu序列号 public string MacAddress; //2.mac序列号…
原文:http://blog.csdn.net/suziluo123/article/details/51382410 最近接触6.0,发现使用单纯的wifiManager.getConnectionInfo().getMacAddress();方法获取不到MAc地址.后来Google一下发现 Google对硬件信息的访问,其管控更加严格.SD 卡的读写,除了权限声明之外,还应该动态请求,否则就会被禁止.至于 MAC 网络地址的获取,相应的 API 返回的最新结果都是 02:00:00:00:0…
摘要 有时候,我们需要获取客户端的一些信息,以便进行统计.比如:客户端的唯一标识,ip等信息 IP 通过获取HTTP_X_FORWARDED_FOR,或者REMOTE_ADDR可以获取客户端的ip. private string GetClientIP() { string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(resu…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Management; namespace _17获取MAC地址 { class Program { static void Main(string[] args) { ManagementObjectSearcher nisc = new ManagementObjectSearcher("sele…
using System; using System.Management; using System.Net; public class Program { static void Main(string[] args) { try { string ip = ""; string mac = ""; ManagementClass mc; string hostInfo = Dns.GetHostName(); //IP地址 //System.Net.IPAdd…
1>通过wmi获取 using System; using System.Management; using System.Net; public class Program { static void Main(string[] args) { try { string ip = ""; string mac = ""; ManagementClass mc; string hostInfo = Dns.GetHostName(); //IP地址 //Sys…
public String GetDeviceMAC() { String strMacAddr = null; try { // 获得IpD地址 InetAddress ip = getLocalInetAddress(); byte[] b = NetworkInterface.getByInetAddress(ip) .getHardwareAddress(); StringBuffer buffer = new StringBuffer(); for (int i = 0; i < b.…