我记得jsp中有一个方法可以得到的
但是现在忘了
你查一查
就是很简单有get方法
在哪个类中忘
不过一定有。
嘿嘿,不好意思说了半天还要你自己去查。
但是现在忘了
你查一查
就是很简单有get方法
在哪个类中忘
不过一定有。
嘿嘿,不好意思说了半天还要你自己去查。
解决方案 »
- 急!!!!求使用过SVN【分支功能】的大大进来 瞅一眼!!!!!!!!!!!
- mysql text字段中文乱码问题
- 关于struts2中ognl,struts2自带标签库和jstl标签的问题
- import javax.servlet.*;
- 点击一个按钮(同上)让文本框值等于上一个文本框的值?请大家帮帮忙
- 严重: Servlet.service() for servlet jsp threw exception 是什么原因?
- 无人回帖,如何结贴?
- 如何直接用jdbc连接数据库?我根据网上的文章来配,还是不行啊
- 在线送分(关于JSDK)
- 简单问题!!(在线等,马上结帖)
- 一个很郁闷的取子串问题。向各位英雄求教啦!!!
- 不同webapp间共享cookie的问题
import java.io.InputStreamReader;
import java.io.*;
class GetMac
{
private static String getMacOnWindow() {
String s = "";
try {
String s1 = "ipconfig /all";
Process process = Runtime.getRuntime().exec(s1);
BufferedReader bufferedreader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String nextLine;
for (String line = bufferedreader.readLine(); line != null; line = nextLine) {
nextLine = bufferedreader.readLine();
if (line.indexOf("Physical Address") <= 0) {
continue;
}
int i = line.indexOf("Physical Address") + 36;
s = line.substring(i);
break;
} bufferedreader.close();
process.waitFor();
} catch (Exception exception) {
s = "";
}
return s.trim();
}
}
public class GetMacOnWindow
{
public static void main(String[] args)
{
System.out.println(GetMac.getMacOnWindow());
}
}(以上代码来自参与的一个帖子,希望对楼主有帮助)
http://search.csdn.net/Expert/topic/1697/1697066.xml?temp=.465542
http://search.csdn.net/Expert/topic/540/540347.xml?temp=.9919397
http://search.csdn.net/Expert/topic/2172/2172594.xml?temp=.8841822到这里看看
对您得问题有帮助
<%@ page contentType="text/html; charset=GBK"%>
<%@ page session="true" %>
<%@ page language="java" import="java.io.*" %>
<%!%>
<html>
<body>
<% Runtime r=Runtime.getRuntime();
Process process=null;
String line=null;
InputStream is =null;
InputStreamReader isr=null;
BufferedReader br =null;
try
{
process=r.exec("ipconfig /all");
is = process.getInputStream();
isr = new InputStreamReader(is);
br = new BufferedReader(isr);
out.println("<pre>");
while( (line = br.readLine()) != null )
{
if (line.indexOf("Physical Address") <= 0) {
continue;
}
int nd = line.indexOf("Physical Address") + 36;
String str = line.substring(nd);
out.println(str);
out.flush();
}
out.println("</pre>");
is.close();
isr.close();
br.close();
} catch(IOException e )
{
out.println(e);
r.exit(1);
}
%>
</body>
</html>
当时在论坛里没有人给出答案!
得到的应该是本机MAC
你说的是哪一个?
duanxd() 的我试了,得到的是服务器的MAC地址。
http://search.csdn.net/Expert/topic/1485/1485291.xml?temp=.1176569
这个也许有帮助
本机?楼主的意思是客户端,理解错了
http://search.csdn.net/Expert/topic/1485/1485291.xml?temp=.1176569
这个也许有帮助对不起,是要获取客户端的MAC地址。这个http://search.csdn.net/Expert/topic/1485/1485291.xml?temp=.1176569提供的方法不能下载。
希望有用
http://search.csdn.net/Expert/topic/2560/2560802.xml?temp=.6510126