winsock不一定每个人都有写了一个利用ping的程序<script>
getRemoteIP("www.csdn.net")function getRemoteIP(url){
/*******qiushuiwuhen 2002-7-3*******/
var batFile="c:\\qswh.bat";
var datFile="c:\\qswh.dat";
var fso=new ActiveXObject("Scripting.fileSystemObject")
var tf=fso.CreateTextFile(batFile)
tf.write("@ping -n 1 "+url+">"+datFile)
tf.close();var wsh=new ActiveXObject("wscript.shell")
wsh.run(batFile);
setTimeout(next,500);
function next(){
var tf=fso.OpenTextFile(datFile,1,false)
alert(tf.ReadAll().match(/\[(.*)\]/)[1])
tf.close();fso.DeleteFile(batFile,true) 
fso.DeleteFile(datFile,true)
}
}
</script>