How to get user ip address in dll file.

vantuminh

New Member
I want to get the user ip address in dll file. I don't know how to do it! I've tried this: <BR><BR>MyObject.vb :<BR><BR>Imports System<BR>Imports System.Collections<BR>Imports System.Web<BR>Imports System.Web.Util<BR>Imports System.Web.UI<BR>Imports System.Web.UI.WebControls<BR>Imports System.Web.UI.HtmlControls<BR>Imports Microsoft.VisualBasic<BR><BR>Namespace MyObject<BR> Public Class Statistic<BR> Public Function GetStatInfo() As String<BR> Dim Request As HttpRequest<BR> Dim User_IP as String = Request.ServerVariables("REMOTE_ADDR")<BR> GetStatInfo = User_IP<BR> End Function <BR> End Class<BR>End Namespace<BR><BR>If someone could help it would be a piece of relief! Thank you.Try the following:<BR>I believe you can then access request, response, and server objects at this point.<BR><BR>Dim context as System.Web.HttpContext = System.Web.HttpContext.Current<BR><BR><BR>Tommy McConnellThank you!!!
 
Back
Top