469,600 Members | 2,393 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

getting computer name from asp-dot-net

i need to get the computer name from an aspx page.
i use System.Windows.Forms.SystemInformation.ComputerNam e()
and it's working fine,
but in second thought, it might not be recomended to use the
system.windows.forms.dll
inside an asp-dot-net code.
any information here will help.
TIA, z.


Nov 18 '05 #1
5 4053
i need to get the computer name from an aspx page.
i use System.Windows.Forms.SystemInformation.ComputerNam e()
and it's working fine,
but in second thought, it might not be recomended to use the
system.windows.forms.dll
inside an asp-dot-net code.
any information here will help.

System.Environment.MachineName

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 18 '05 #2
do you have something instead of
System.Windows.Forms.Application.StartupPath

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
i need to get the computer name from an aspx page.
i use System.Windows.Forms.SystemInformation.ComputerNam e()
and it's working fine,
but in second thought, it might not be recomended to use the
system.windows.forms.dll
inside an asp-dot-net code.
any information here will help.

System.Environment.MachineName

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 18 '05 #3
do you have something instead of
System.Windows.Forms.Application.StartupPath


How are you using it? I don't see how the startup path would be
relevant in a web app.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 18 '05 #4
I'd check your computer name again, I'm pretty sure the computer name is the
server that has your ASPX page on it, not the client computer name.
If it is returning the right name it's probably because you're testing your
code on the same computer that has your ASPX page. That's why you think it's
working.

You can't get a computer name from a client computer from a ASPX page.
The reason is, a computer name how your looking at it is a Windows
"attribute" if you will. If you use
'System.Windows.Forms.SystemInformation.ComputerNa me()' you're implying that
your running on a NTLM Network.

FreeBSD, Linux, Solaris, etc have computer names when setup in an DNS, but
there not the same as the windows computer name.

System.Security.Principal.WindowsIdentity can get you user information if
you've setup IIS with Windows Authentication (NTLM), then the
WindowsIdentity information will be filled in. If you don't setup Windows
Authentication then WindowsIdentity will be null.

If you want remote client information, the thing to look at is:
HttpRequest.ServerVariables

I wouldn't rely too much on this only because any client can spoof this
information.
"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
i need to get the computer name from an aspx page.
i use System.Windows.Forms.SystemInformation.ComputerNam e()
and it's working fine,
but in second thought, it might not be recomended to use the
system.windows.forms.dll
inside an asp-dot-net code.
any information here will help.
TIA, z.

Nov 18 '05 #5
it is used inside a "general purpose" DLL library that is referenced from
web apps and windows apps as well.
so i there a replacement for Application.StartupPath not from
System.Windows.Forms.Dll ?


"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
do you have something instead of
System.Windows.Forms.Application.StartupPath


How are you using it? I don't see how the startup path would be
relevant in a web app.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Maverick | last post: by
4 posts views Thread by Matt | last post: by
3 posts views Thread by RR | last post: by
7 posts views Thread by Shahid Juma | last post: by
5 posts views Thread by Sin Jeong-hun | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.