|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RE: HttpContext.Current always returns NULL when called from Classic ASPHere is the code: if(System.Web.HttpContext.Current != null) { strRemoteAddr = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); } else { try { ASPTypeLibrary.Request oRequest = (ASPTypeLibrary.Request) System.EnterpriseServices.ContextUtil.GetNamedProperty("Request"); strRemoteAddr = oRequest.ServerVariables["REMOTE_ADDR"].ToString(); } catch(Exception e) { m_lastfailurereason = "Sorry, method for obtaining remote address failed" + m_remoteAddr + "Exception: " + e.ToString(); return false; } } Can you suggest how it could be made to work? From http://www.developmentnow.com/g/6_2003_10_0_0_68266/HttpContext-Current-always-returns-NULL-when-called-from-Classic-ASP.htm Posted via DevelopmentNow.com Groups http://www.developmentnow.com |
|||||||||||||||||||||||