[CODE]
<script language="JavaScript">
function GetLocalIPAddr(){
var oSetting = null;
var ip = null;
try{
oSetting = new ActiveXObject( "rcbdyctl.Setting" );
ip = oSetting.GetIPAddress;
alert(ip);
if (ip.length == 0) {
return "没有连接到Internet";
}
oSetting = null;
} catch(e) {
return ip;
}
return ip;
}
</script>
<button onclick="alert(GetLocalIPAddr()) ">得到ip的方法1</button>
<script>
function getIP(bat,txt){
var fso=new ActiveXObject("Scripting.FileSystemObject")
var f=fso.createTextFile(bat,1);
f.writeLine("ipconfig>"+txt);
f.Close();
var wsh=new ActiveXObject("wscript.shell");
wsh.run(bat)
setTimeout(display,1000)
function display(){
var f=fso.openTextFile(txt);
alert(f.ReadAll());
f.Close();
fso.DeleteFile(bat);
fso.DeleteFile(txt);
}
}
</script>
<button onclick="getIP('qswhIP.bat','qswhIP.txt')">得到ip的方法2</button>
[/CODE]
[此贴子已经被作者于2005-12-5 12:38:21编辑过]

吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己