473,473 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[2008] ASP.NET (VB) - How to retreive a client's IP

I got an intranet web site and there is a proxy on the network.
I want to retreive a client's IP, how could I get it ?
Jun 27 '08 #1
2 1464
Some proxies report in a request's header the actual client IP address.
There are 2 or 3 standard headers. x-forwarded-for is one of them

But some proxies do not do it. Those proxies called anonymous proxies by the
way.

George.

"Doken13" <as*****@hotmail.comwrote in message
news:ud**************@TK2MSFTNGP04.phx.gbl...
>I got an intranet web site and there is a proxy on the network.
I want to retreive a client's IP, how could I get it ?

Jun 27 '08 #2
Doken13, here's sample code to retrieve either a real client IP
or a proxy's IP...and determine which is which :

// HTTP_VIA is not null if there's a proxy between your server and the client
if(Context.Request.ServerVariables["HTTP_VIA"]!=null)

{
// So, this code returns the client's real IP
ip=Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else
{
// not using proxy or can't get the Client IP
//doesn't get the Client IP, but returns proxy IP
ip=Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
}

As George says, you can not always get the Client IP through a proxy because
either a proxy will not send the client IP to you or a client can also be prevented
from sending its IP by the use of "header_access deny".

--
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"George Ter-Saakov" <gt****@cardone.comwrote in message news:uw**************@TK2MSFTNGP05.phx.gbl...
Some proxies report in a request's header the actual client IP address.
There are 2 or 3 standard headers. x-forwarded-for is one of them

But some proxies do not do it. Those proxies called anonymous proxies by the way.

George.

"Doken13" <as*****@hotmail.comwrote in message news:ud**************@TK2MSFTNGP04.phx.gbl...
>>I got an intranet web site and there is a proxy on the network.
I want to retreive a client's IP, how could I get it ?


Jun 27 '08 #3

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

Similar topics

1
by: Spam | last post by:
How can i retreive the structure of a dtd in my VB.net assembly so i can display the structure i know how to read a schema but it doesnt seem to work with a dtd
6
by: John Grandy | last post by:
Does C# have an equivalent for VB.NET's Redim Preserve ? ReDim Preserve increases the final dimension of any array while preserving the array's contents (however, the type of the array may not be...
2
by: conraba | last post by:
I am creating a modal dialog box in ASP.NET via client-side javascript and passing vArguments parameters in an array form using this syntax: vReturnValue = window.showModalDialog(sURL ) ...
2
by: mattfracassa | last post by:
VB 2005, .net 2.0 Is there an easy way to save the items checked in a CheckedListBox for each user (so that everytime the user opens the app, it remembers and displays what was checked.) I...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
6
by: Miro | last post by:
I can run an exe ( and its install ) i have created on my machine. The exe has a button that populates a dataset and then shoots it to a crystal report. But... Installing the setup.exe on my...
4
by: Miro | last post by:
<i have also added this reply to the other newsgroup - now that I have realizd ( and assuming ) it is not a localized error directly to vb.> I have found this link on the website:...
0
by: lathamoulali | last post by:
Hello, I have a MSCHart Control in VB.NET and i have copied the Chart to Clipboard .. Now i want to retreive the image and save it as a bitmap... But i am unable to do this as i am getting an...
4
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.