您可以使用ADO記錄集作爲一個包裝
Set objADSysInfo = CreateObject("ADSystemInfo")
strUser = objADSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
objUser.CN
ret = send2PHP("yourpage.php?data=", strUser)
function send2PHP(phpURL, data)
on error resume next ' if your php page returns a valid recorset you can omit 'on error
set rsPHP = wscript.createobject("adodb.recordset")
'here you must serialize "data" to be a valid uri value (not done here) '
rsPHP.open phpURL & data ,,,, 256 ' this statment (and the following ones) '
if not rsPHP.eof then send2PHP = rsPHP(0) ' fails if you do not return a valid recordset '
rsPHP.close ' form php script, but at least you '
set rsPHP = nothing ' have the "data" within the php anyway '
end function