F_GET_DOMAIN_AND_USERNAME_COMPUTERNAME

// Function Name : f_get_domain_and_username_and_
computername
// Argument Name : as_Domain, Arg Type : string, Pass By : Reference
//                            as_UserName, Arg Type : string, Pass By : Reference
//                            as_ComputerName, Arg Type : string, Pass By : Reference
// Return Type :       (None)

Integer li_connect
OleObject ole_wsh

ole_wsh = Create OleObject

li_connect = ole_wsh.ConnectToNewObject("WScript.Network")

If li_connect = 0 Then
    as_Domain = ole_wsh.UserDomain
    as_UserName = ole_wsh.UserName
    as_ComputerName = ole_wsh.ComputerName
End If

0 comments:

Post a Comment