|
-
Oct 9th, 2009, 06:22 PM
#1
Thread Starter
New Member
IP address logging
HI All,
I am new to VB script. i want to log users IP addresses who accessing my system. is it possible to do in VB Script.
Thanks,
Prabhu Selvakumar
-
Oct 10th, 2009, 01:18 AM
#2
Re: IP address logging
Yes - Request.ServerVariables("REMOTE_ADDR") will contain the user's IP address. Then you can write it to a text file, insert it to database, etc.
-
Oct 12th, 2009, 06:28 PM
#3
Thread Starter
New Member
Re: IP address logging
Thanks SambaNeko, could you please share the script.... i have tried lot but i could not find it... please help me on this...
-
Oct 12th, 2009, 06:50 PM
#4
Thread Starter
New Member
Re: IP address logging
i have tried below script to print the remote IP who accessing my system
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Do while(true)
wscript.echo "******** " & Request.ServerVariables("REMOTE_ADDR")
Loop
the above code is not working... could you please help me on this.
-
Oct 13th, 2009, 06:23 PM
#5
Re: IP address logging
Ah, you're actually asking something different than what I thought you were. Not sure how to get the IP in your scenario. Is this of any use? The relevant part:
Code:
'Get IP address of the computer and display it in the window
Set IPConfigSet = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
objdocument.WriteLn "IP Address: " & IPConfig.IPAddress(i) & "<br>"
Next
End If
Next
That may only be getting the IP of your own system though... I'm really not sure.
-
Oct 14th, 2009, 12:02 PM
#6
Thread Starter
New Member
Re: IP address logging
Thanks for your reply SambaNeko, i hope the above code will print my system IP address.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|