That's not what he was looking for.
He was looking for "the IP Address of the
server where the code behind is running".
re:
> lblAccount.text = System.Security.Principal.WindowsIdentity.GetCurre nt().Name
That should be
System.Security.Principal.WindowsIdentity.GetCurre nt.Name()
I published this short file I wrote, which retrieves the
account name ASP.NET is running under, a few days ago.
Check it out...
-----------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsIdentity.GetCurrent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
-------------
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Sccr18" <> wrote in message
news:4EBA0623-F365-4885-9B2C-...
> I'm not sure if this exactly what you want to do, but you can display the
> account that an ASP.net page is exeuting by in Sub Page_Load
> lblAccount.text = System.Security.Principal.WindowsIdentity.GetCurre nt().Name
> Hope this helps.
>
> Sccr18
>
> "Juan T. Llibre" wrote:
>
>> Request.ServerVariables("LOCAL_ADDR")
>>
>> would provide the server's IP address, too.
>>
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Español
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Joseph Byrns" <> wrote in message
>> news:...
>> > You can do:
>> >
>> > System.Net.Dns.GetHostByName(System.Net.Dns.GetHos tName()).AddressList(0).ToString
>> >
>> >
>> > "Carlo Marchesoni" <> wrote in
>> > message news:B7B38011-0358-4A6C-AA26-...
>> >>I looked in the help but I cannot find the method to retrieve the
>> >>IP-Address
>> >> of the local machine in the code behind (not the client machine, wich I
>> >> can
>> >> retrieve with Request.UserHostAddress, but the IP-Address of the server
>> >> where
>> >> the code behind is running).
>> >> I checked IPAddress Class but this seems not to be the correct one.
>> >> Thank you for your help
>> >
>> >
>>
>>
>>
>>