472,347 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 4145
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Maverick | last post by:
I'm trying to get the " Computer Name " of a client accessing my web site, is there a way to do this ? not ip... tia
4
by: Matt | last post by:
Hi everybody, does anyone know how to retrieve the computer name using ASP? cheers...
2
by: TIML | last post by:
I have tried using servervariables("XXX") to request the username and computer name of the individual running code on our internal server, but what...
3
by: RR | last post by:
I'm developing a web app and, for the user's convenience, I'd like to display their local computer name (i.e. the name of the computer the browser...
4
by: Dr. StrangeDub | last post by:
Leaving network identification/DNS out of the picture, how does one change the name of a computer in a local Workgroup (in C#)? I implemented the...
7
by: Shahid Juma | last post by:
Hi, How can I retrieve the computer name of the browser and output it to the webpage in ASP/VBScript? Thanks in advance, Shahid
1
by: ad | last post by:
I want to get some data for log. How can we get the use's IP and computer name?
2
by: Ben | last post by:
Hi, Thanks for reading this post... I am trying to get the computer/server names from the mapped drives on the Clients PC when they select a file...
0
by: BrianT | last post by:
I'm trying to build code that allows the computer name to be changed, then asks the user to reboot to make the change affective. I got the code...
5
by: Sin Jeong-hun | last post by:
Hello. Speical folders, like Desktop, usually have different display names. For example, in Japanese Windows, it's displayed as...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.