TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
manohar vakkala
NA
72
142.4k
Tracking IP Address
Mar 30 2011 12:03 AM
Hi All,
I want to track the user IP address.
I have tried using DNS & Request objects to get the user IP address. Its working only in local PC not in server. May be this is because i'm missing a step to implement in server.
So, Please give me a solution other than using DNS & Request objects (or) please explain me how to implement this DNS & Request.
Thanks All,
Manohar
Reply
Answers (
2
)
0
Crish
0
2.4k
91.8k
Mar 30 2011 1:32 AM
Dim strClientIP As String
strClientIP = Request.UserHostAddress()
Response.Write(strClientIP)
0
Krishna Garad
0
15.6k
8.5m
Mar 30 2011 12:31 AM
Check this sample
(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://www.whatismyip.org");
request.UserAgent = "User-Agent: Mozilla/4.0 (compatible; MSIE" +
"6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
using (System.IO.StreamReader reader = new
StreamReader(response.GetResponseStream()))
{
string myExternalIP = reader.ReadToEnd();
reader.Close();
}
savefiledialogbox file name readonly
Datagridview cell validation only for Numbers