Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error on getting ip address in html page

Status
Not open for further replies.

jfdabiri

MIS
Feb 27, 2007
282
US
hi,
i have this hta that sends an mail with user info and ip address. it works fine as hta. but when we change to html, it errors out on the ip address part.
here's the code:
Code:
StrComputer = "."
  Set objWMIService = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

  Set colAdapters = objWMIService.ExecQuery _
      ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
   
  For Each objAdapter in colAdapters
      If Not IsNull(objAdapter.IPAddress) Then      
         msg = msg & "IP address: " & objAdapter.IPAddress(0) & vbcrlf      
      End If
  next 

  ip_address_arr = split(msg, vbcrlf)
  ip_address = ip_address_arr(0)
is there any other way to get ip addres? or fix this to not error out on html?
thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top