473,889 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ 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.SystemInf ormation.Comput erName()
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 4305
i need to get the computer name from an aspx page.
i use System.Windows. Forms.SystemInf ormation.Comput erName()
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.Environm ent.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.Applicati on.StartupPath

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:OD******** ******@TK2MSFTN GP09.phx.gbl...
i need to get the computer name from an aspx page.
i use System.Windows. Forms.SystemInf ormation.Comput erName()
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.Environm ent.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.Applicat ion.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.SystemIn formation.Compu terName()' 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.Wind owsIdentity 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.Ser verVariables

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******** **********@TK2M SFTNGP10.phx.gb l...
i need to get the computer name from an aspx page.
i use System.Windows. Forms.SystemInf ormation.Comput erName()
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.Sta rtupPath not from
System.Windows. Forms.Dll ?


"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:u2******** ******@TK2MSFTN GP09.phx.gbl...
do you have something instead of
System.Windows .Forms.Applicat ion.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
41607
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
5477
by: Matt | last post by:
Hi everybody, does anyone know how to retrieve the computer name using ASP? cheers...
2
2577
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 network logon and computer name. The user's logon anonymously. Server: Windows 2000 Workstations: Windows XP Tim
3
61677
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 script that will deliver this and I've also tried some VBScript (which I know nothing about). I found a script that did this: var oShell = new ActiveXObject("Shell.Application");
4
14321
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 change the NetBIOS Computer Name. I've verified that the underlying registry key value that gets changed is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName Is there a recommended API (via Active...
7
11469
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
1015
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
3578
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 clicks on the "Browse" button on the "<input type="File"... control and selects a file located in one of many possible mapped drives. I want to save the location of the file as a path as you would see when mapping a drive. For instance,...
0
1933
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 administrator or a domain administrator, but a regular domain user (with administrator privileges on the local machine) can't run the code successfully. They get error 1219, which I believe means "Multiple connections to a server or shared resource by the same...
5
7536
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 special folder but I can't find a suitable method. Environment.GetFolderPath() is to get the path not the name. There's no way provided the .NET BCL? I also tried to get it through Win32 API. I looked up the MSDN site...
0
9961
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9803
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11187
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7148
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6021
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.