2
Answers

HttpContext - access issue

Photo of Mansoor Mohammed

Mansoor Mohammed

6y
1.3k
1

How do I resolve this

I get this error on HttpContext, when I try to get the server Name

httpcontext is not declared it may be inaccessible due to its protection level

Dim strServerName As String = If((HttpContext.Current IsNot Nothing), HttpContext.Current.Request.ServerVariables("LOCAL_ADDR").ToString(), Environment.MachineName)

Answers (2)