|
 |
aspx thread: could you tell me how to know ip address of client on my homepage?
Message #1 by "MIN HO IM" <marsimh@y...> on Sun, 11 Aug 2002 05:33:59
|
|
could you tell me how to know the ip address of client on my homepage? in
asp.net using C# when a client connect at my homepage
give me the information or code.
it's my first question.
Message #2 by Ali Ahmad H <aheryana@b...> on Mon, 12 Aug 2002 15:54:04 +0700
|
|
This one way that i've used in my page :
string IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
regards,
-ali-
At 05:33 AM 8/11/2002 +0000, you wrote:
>could you tell me how to know the ip address of client on my homepage? in
>asp.net using C# when a client connect at my homepage
>
>give me the information or code.
>
>it's my first question.
Message #3 by "Juan T. Llibre" <j.llibre@c...> on Mon, 12 Aug 2002 08:43:41 -0400
|
|
Instead of using the ServerVariables collection,
I prefer to use Request.UserHostAddress:
<%@ Page language="C#" %>
<html>
<body>
<%
String ClientIP;
ClientIP=Request.UserHostAddress.ToString();
IP.Text=ClientIP;
%>
<form runat="server">
<p>
<asp:Label id="IP" runat="server" />
</p>
</form>
</body>
</html>
best,
Juan T. Llibre
Microsoft MVP [IIS/ASP]
ASP.NET en Espaņol : http://asp.net.do/
==============================
----- Original Message -----
From: "Ali Ahmad H" <aheryana@b...>
To: "ASP+" <aspx@p...>
Sent: Monday, August 12, 2002 4:54 AM
Subject: [aspx] Re: could you tell me how to know ip address of client on my
homepage?
> This one way that i've used in my page :
>
> string IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
>
> regards,
> -ali-
>
> At 05:33 AM 8/11/2002 +0000, you wrote:
> >could you tell me how to know the ip address of client on my homepage? in
> >asp.net using C# when a client connect at my homepage
> >
> >give me the information or code.
> >
> >it's my first question.
>
>
>
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET namespaces
> for developers who are already familiar with using ASP.NET.
> There is no trivial introductory material or useless .NET
> hype and the presentation of the namespaces, in an easy-to use
> alphabetical order ensures a user-friendly reference format.
> We provide in-depth coverage of all the major ASP.NET classes,
> giving you those real-world tips that the documentation doesn't
> offer, and demonstrating complex techniques with simple
> examples.
>
> ---
|
|
 |