Ronnie Overby
Ronnie Overby

Reputation: 46470

How can you tell if an an ASP.NET request is remote or from localhost?

How can you programmatically determine if an an ASP.NET request is remote or from the localhost?

Upvotes: 7

Views: 205

Answers (3)

Ronnie Overby
Ronnie Overby

Reputation: 46470

I found it: HttpContext.Current.Request.IsLocal

Upvotes: 13

Harendra
Harendra

Reputation: 249

yes HttpContext.Current.Request.IsLocal will must works. I am also using it in one of my project and working fine.

Upvotes: 0

Dean Harding
Dean Harding

Reputation: 72658

You can check the Request.UserHostAddress property.

Upvotes: 0

Related Questions