获取JS的几个URL地址的以下方法
复制代码代码如下所示:
thisurl = document.url;
thishref = document.location.href;
thissloc = self.location.href;
thisdloc = document.location;

thistloc = top.location.href;
thisploc = parent.document.location;
thisthost = top.location.hostname;
thishost = location.hostname;

tmphpage = thishref.split( / );
thishpage = tmphpage { tmphpage length-1 };
tmpupage = thisurl.split( / );
thisupage = tmpupage { tmpupage length-1 };

以下是使用js获取MAC地址、IP地址和主机名的方法:
复制代码代码如下所示:












MAC地址:
IP地址:
主机名:





无功smacaddr = ;
无功sipaddr = ;
无功sdnsname = ;

无功服务= locator.connectserver();
服务。security_ impersonationlevel = 3;
service.instancesofasync(Foo,'win32_networkadapterconfiguration);




如果(objobject.ipenabled!= null objobject.ipenabled!=未定义objobject.ipenabled = = true){
如果(objobject.ipenabled objobject.ipaddress(0)!= null objobject.ipaddress(0)!=未定义
sipaddr = objobject.ipaddress(0);
如果(objobject.macaddress!= null objobject.macaddress!=未定义
smacaddr = objobject.macaddress;
如果(objobject.dnshostname!= null objobject.dnshostname!=未定义
sdnsname = objobject.dnshostname;
}




以下是我参考网上的价值= smacaddr。MAC地址;
以下是我参考网上的价值= sipaddr。IP地址;
以下是我参考网上的价值= sdnsname。主机名;