473,480 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4270
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
41543
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
5451
by: Matt | last post by:
Hi everybody, does anyone know how to retrieve the computer name using ASP? cheers...
2
2555
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 I want and can't seem to capture is the user's...
3
61431
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 is running on). I've looked very hard to find a...
4
14268
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 SetComputerName() API call and that only seems to...
7
11358
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
1000
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
3558
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 from the upload "browse" button. When the user...
0
1877
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 working when logged in as the local computer...
5
7514
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 "$B%G%9%/%H%C%W(B". I want to get the this displayed name of a...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
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
7043
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,...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6921
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4776
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4481
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
2995
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...

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.