Client IP

  • Thread starter Thread starter Steven Caliendo
  • Start date Start date
S

Steven Caliendo

Hi,

I need to know what the IP address of the client coming into my web site is.
How do I grab that? Can I do that in the Session_Start module ?

Thanks,

Steve
 
Yes,

Session_Start will work fine and you can still use the servervariables to
get the ip address. Of course in the Global.asax.vb file...

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
sClientIP = Request.ServerVariables("HTTP_USER_AGENT"))
End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
'do something here, clean up temp directories based on
session.id, et..
End Sub
 
Back
Top