?
Solved

Display IP Address of Remote user on page in ASP.NET 2.0

Posted on 2006-05-15
3
Medium Priority
?
1,302 Views
Last Modified: 2012-06-27
I am looking to display the IP Address on the page of the person surfing my site in ASP.NET 2.0. Some of these things are new to me. I am getting lost in translation from PHP to ASP.NET 2.0 in Visual Studios 2005.
   
 Dim myIPAddress As New ViewStateException
    If myIPAddress.RemoteAddress = "" Then
        Response.Write("Nothing to Show")
    Else
        Response.Write(CStr(myIPAddress.RemoteAddress))
    End If
0
Comment
Question by:iamtgo3
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
laotzi2000 earned 200 total points
ID: 16685555
Response.Write(Request.UserHostAddress)
0
 
LVL 1

Author Comment

by:iamtgo3
ID: 16685974
laotzi2000

Thanks found two way actually.

    Response.Write(Request.ServerVariables("REMOTE_ADDR"))
    Response.Write(Request.UserHostAddress)

Here is a different question

In PHP you can get the HTTP Root like this. How would you translate that to ASP.NET?
<a href='<?PHP $_SERVER['HTTP_ROOT'] ?>/sitemap.php'>Site Map</a>

0
 
LVL 12

Expert Comment

by:laotzi2000
ID: 16686203
Don't quite understand what HTTP_ROOT is.

Are you looking for this: Request.ApplicationPath.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question