也许是好东西——Windows Script Host-1[获取网络识别信息]

来源:岁月联盟 编辑:zhuzhu 时间:2003-07-11
//************************************************
// File:    Network.js (WSH sample in JScript)
// Author:  (c) G. Born
//
// Showing the user name, domain name, and
// workgroup name
//************************************************

var Text = "Networking information/n/n";

// Create WshNetwork object to access network properties.
var WshNetwork = WScript.CreateObject("WScript.Network");

Text = Text + "Computer name : " + WshNetwork.ComputerName + "/n";
Text = Text + "Domain : " + WshNetwork.UserDomain + "/n";
Text = Text + "User name : " + WshNetwork.UserName + "/n";

WScript.Echo(Text);

//*** End