473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to get the IP of Server and client?

ad
Hi,
I am use VS2005 to develop Web application.
How can I get the server's and client's IP with program?
Aug 20 '06 #1
5 1156
Try to use this:
to get HOST IP use Request.ServerVariables["LOCAL_ADDR"]
to get client IP use Request.UserHostAddress

--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"ad" wrote:
Hi,
I am use VS2005 to develop Web application.
How can I get the server's and client's IP with program?
Aug 20 '06 #2
"Muhammad Mosa" <Mu**********@discussions.microsoft.comwrote in message
news:64**********************************@microsof t.com...
to get client IP use Request.UserHostAddress
This can't be relied upon, due to firewalls, proxies, IP spoofing etc...
Aug 20 '06 #3
Mark,

Under that argument, nothing can be relied upon that is sent from the
client :) . As far as stats go (and as I work with them) getting the
request IP is the closest to obtaining the user's IP. Unless there is a
better way?

Sarat

Mark Rae wrote:
"Muhammad Mosa" <Mu**********@discussions.microsoft.comwrote in message
news:64**********************************@microsof t.com...
to get client IP use Request.UserHostAddress

This can't be relied upon, due to firewalls, proxies, IP spoofing etc...
Aug 20 '06 #4
"Sarat Pediredla" <sa*************@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Under that argument, nothing can be relied upon that is sent from the
client :) .
That's pretty much the case - quite a few browsers have an "impersonate"
option where they can "appear" to be something else entirely...
As far as stats go (and as I work with them) getting the request IP is the
closest to obtaining the user's IP.
So long as you trust your users not to spoof it...
Unless there is a better way?
There isn't...
Aug 20 '06 #5
Sarat Pediredla wrote:

Sarat,
>
Under that argument, nothing can be relied upon that is sent from the
client :) . As far as stats go (and as I work with them) getting the
request IP is the closest to obtaining the user's IP. Unless there is a
better way?
Have a look at the properties of my earlier reply - you can see from my
IP address that I'm in the UK, etc...

Have a look at the properties of this reply - where do you think I am
now?

You simply cannot rely on the IP address reported to your server...

Mark

Aug 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matt | last post by:
I think this is the basic concept in ASP server-side development. My boss told me web application is NOT client-server application. I argued with him because browser is the client, and the server...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
2
by: Microsoft | last post by:
I'm about to start converting my application from a old-style monolith exe (with flat files and limited database support for sharing some of the data) to a layered .NET SQL server version. I have...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
4
by: jens Jensen | last post by:
Hello, I was given the task to build a .Net client that will talk to IBM integration server via HTTP post. The idea is that each http packet exchange should be authenticated via X09 "client...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.