本文目录一览:
- 1、ASP 如何获取手机(或电脑)MAC地址 和 如何获取手机型号 和手机 IMEI
- 2、请问java如何获取手机mac地址?
- 3、Xss清除mac
- 4、如何在手机上获得自己的mAC地址?
- 5、怎么获取手机的MAC地址
- 6、android怎样获取手机mac
ASP 如何获取手机(或电脑)MAC地址 和 如何获取手机型号 和手机 IMEI
取得电脑的mac地址需要通过activeX控件来实现。具体怎样搞我也在很久以前做过1次,已经忘记了。baidu上应该有解答
但是,各种网页语言都是服务器端语言,要获取客户端的一些信息,必须客户端提交到服务器端才能得到。
而Mac地址是不需要在Internet上传播的,在Internet上传播的是IP地址。计算机网络里三层网络就是基于ip的网络(大概意思),而Mac地址是在2层内传播的。
像硬盘号、Mac地址等要获取,就只能通过客户端控件来实现。
手机的IMEI没有接触过,估计也和电脑的Mac地址差不多。。。。
说了这么多,不知道说清楚没有。。。。。
请问java如何获取手机mac地址?
以windows举例。
运行命令" cmd ipconfig /all"就会出现以下结果
Physical Address. . . . . . . . . : 20-CF-30-9A-60-EE
。
java就能过这样的命令来获取。以下是示例。
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestMac
{
public static void main(String[] args) {
System.out.println("Operation System=" + getOsName());
System.out.println("Mac Address=" + getMACAddress());
System.out.println("通过ip获取mac"+getMACAddress("192.168.1.101"));
}
public static String getOsName() {
String os = "";
os = System.getProperty("os.name");
return os;
}
public static String getMACAddress() {
String address = "";
String os = getOsName();
if (os.startsWith("Windows")) {
try {
String command = "cmd.exe /c ipconfig /all";
Process p = Runtime.getRuntime().exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
if (line.indexOf("Physical Address") 0) {
int index = line.indexOf(":");
index += 2;
address = line.substring(index);
break;
}
}
br.close();
return address.trim();
} catch (IOException e) {
}
} else if (os.startsWith("Linux")) {
String command = "/bin/sh -c ifconfig -a";
Process p;
try {
p = Runtime.getRuntime().exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
if (line.indexOf("HWaddr") 0) {
int index = line.indexOf("HWaddr") + "HWaddr".length();
address = line.substring(index);
break;
}
}
br.close();
} catch (IOException e) {
}
}
address = address.trim();
return address;
}
public static String getMACAddress(String ipAddress) {
String str = "", strMAC = "", macAddress = "";
try {
Process pp = Runtime.getRuntime().exec("nbtstat -a " + ipAddress);
InputStreamReader ir = new InputStreamReader(pp.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
for (int i = 1; i 100; i++) {
str = input.readLine();
if (str != null) {
if (str.indexOf("MAC Address") 1) {
strMAC = str.substring(str.indexOf("MAC Address") + 14,
str.length());
break;
}
}
}
} catch (IOException ex) {
return "Can't Get MAC Address!";
}
//
if (strMAC.length() 17) {
return "Error!";
}
macAddress = strMAC.substring(0, 2) + ":" + strMAC.substring(3, 5)
+ ":" + strMAC.substring(6, 8) + ":" + strMAC.substring(9, 11)
+ ":" + strMAC.substring(12, 14) + ":"
+ strMAC.substring(15, 17);
//
return macAddress;
}
}
剑天梦的回答原理和我这个一样,都是通过Process 执行命令。 我直接补充到答案里了。不过
我这边运行那个命令出来的结果很多,那么花的时间就长了。优点是能够获取别人的mac地址 。
Xss清除mac
没办法修改和清除。
mac地址是物理地址且全网唯一,被网卡厂商固化在硬件里,没办法修改。一些所谓修改Mac地址软件实际上是在软件里模拟。
xss概念:完全值得的次世代主机 xbox series s (简称xss) 可以说是次世代最便宜的主机,微软也号称这是一款完完全全的次世代主机。
如何在手机上获得自己的mAC地址?
打开手机设置,无线和网络,WLAN,找到WLAN设置,就可以看到自己的IP和MAC地址
怎么获取手机的MAC地址
1
找到手机上“设置”菜单,如图所示,点击进入。
2进入“设置”后,找到“关于手机”,如图所示,点击进入。
3找到“状态信息”,如图所示,点击进入。
4向下翻菜单,即可找到“WLAN MAC地址”,这个信息即是我们需要的手机MAC地址
android怎样获取手机mac
与IP不同,MAC是指连接WIFI使用的无线网卡的物理地址,这个地址是唯一并且不可变更的。从Android手机中当前的系统分布来看是可以正常获取到的。以安卓2.3系统为例,是在设置--关于手机--状态信息进行查看。其他版本的安卓系统查看路径可能会有所变更但变化不大。 另,如果你无法查看到MAC地址,通常也会伴随另一个现像,就是无法连接WIFI,此情况如果你在重启了你的设备并且重新启动了WIFI开关仍未改善,请按故障处理。