473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

get computer name

Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an intranet
and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan
Nov 18 '05 #1
9 3923
Get IP, you can then reverse lookup, otherwise have you looked through the
Request.ServerVariables collection?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an
intranet
and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #2
http://support.microsoft.com/default...5BLN%5D;245574

You could also get the IP and resolve it yourself using System.Net.Dns (or
seach for "Dns" in namespaces).

Patrice

--

"Dan Nash" <da*@musoswire.co.uk> a écrit dans le message de
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an intranet and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #3
Request.ServerVariables("REMOTE_HOST") will give you the machine name (if
available.)

Request.ServerVariables("REMOTE_ADDR") will give you the IP address of the
client machine. However, the true IP address may be masked by proxy servers
so you can't entirely rely on it being unique.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an
intranet
and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #4
Hi guys,

Thanks for the replies. Remote Host just gives me the IP address 127.0.0.1
?? That's not right, obviously. What am I doing wrong? (Machine does have a
name, tis called "DANS" ... which is what I want to retrieve)

Cheers
Dan

"Dan Nash" wrote:
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an intranet
and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #5
Don't test using "localhost". localhost is a special case as it is always
the PC on which you are and will give always the same "local" IP address...

If you want to test on your own OC, use its name rather than localhost...

Patrice
--

"Dan Nash" <da*@musoswire.co.uk> a écrit dans le message de
news:F0**********************************@microsof t.com...
Hi guys,

Thanks for the replies. Remote Host just gives me the IP address 127.0.0.1
?? That's not right, obviously. What am I doing wrong? (Machine does have a name, tis called "DANS" ... which is what I want to retrieve)

Cheers
Dan

"Dan Nash" wrote:
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an intranet and want to know which machine sent the report. All machines are listed on the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #6
System.Enviroment.MachineName to get the name of the machine the error
occurred on.

bill

"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an intranet and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan

Nov 18 '05 #7
Spot on. Thanks a lot Bill.

Just out of interest... Patrice, how did you mean dont use local host? I
wasn't using any IP addys? Just the line

Request.ServerVariables["REMOTE_HOST"];

Justwondering for future reference! :o)

"William F. Robertson, Jr." wrote:
System.Enviroment.MachineName to get the name of the machine the error
occurred on.

bill

"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an

intranet
and want to know which machine sent the report. All machines are listed on
the workgroup and in AD.

Any suggestions?

Cheers
Dan


Nov 18 '05 #8
If you test using http://localhost/mypage.aspx,
Request.ServerVariables("REMOTE_HOST") will return always 127.0.0.1
If you test using http://mymachine/mypage.aspx, it will return the "true" IP
Address and you'll be able to resolve the IP to a name.

System.Environment.MachineName gives the name of the machine where the
application runs (ie. server side). It looks like to me you want the name of
the client side machine.

I believe you are perhaps a bit confused as you are likely testing for now,
on a single machine ?

Hope it helps.

Patrice

--

"Dan Nash" <da*@musoswire.co.uk> a écrit dans le message de
news:22**********************************@microsof t.com...
Spot on. Thanks a lot Bill.

Just out of interest... Patrice, how did you mean dont use local host? I
wasn't using any IP addys? Just the line

Request.ServerVariables["REMOTE_HOST"];

Justwondering for future reference! :o)

"William F. Robertson, Jr." wrote:
System.Enviroment.MachineName to get the name of the machine the error
occurred on.

bill

"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an

intranet
and want to know which machine sent the report. All machines are listed on the workgroup and in AD.

Any suggestions?

Cheers
Dan


Nov 18 '05 #9
Incase Patrice doesn't reply....

I think what Patrice means is when you are on the same machine browsing as
the webserver, not all the same headers get sent over to the web server
side. IE I guess realizes that it is on the same machine and leaves out
some things. Like changing the IP address over to 127.0.0.1 instead of the
IP address of your machine.

This only is an issue when you are browsing and servering on the same
machine, if an issue at all. All my developers develop and test on the same
machine. I am sure Patrice just wanted you to be aware of it.

bill
"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:22**********************************@microsof t.com...
Spot on. Thanks a lot Bill.

Just out of interest... Patrice, how did you mean dont use local host? I
wasn't using any IP addys? Just the line

Request.ServerVariables["REMOTE_HOST"];

Justwondering for future reference! :o)

"William F. Robertson, Jr." wrote:
System.Enviroment.MachineName to get the name of the machine the error
occurred on.

bill

"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:46**********************************@microsof t.com...
Heylo

I want to be able to get the computer name from my C# page. Is this
possible? Basically, I'm developing a auto-bugreport feature for an

intranet
and want to know which machine sent the report. All machines are listed on the workgroup and in AD.

Any suggestions?

Cheers
Dan


Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jim Scheffler | last post by:
I'm new to VB.NET programming and would like some help on a little project I've got going. How would I go about getting computer information on my local computer, i.e. serial number, hard drive...
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 SetComputerName() API call and that only seems to...
5
by: z. f. | last post by:
i need to get the computer name from an aspx page. i use System.Windows.Forms.SystemInformation.ComputerName() and it's working fine, but in second thought, it might not be recomended to use the...
0
by: Daylor | last post by:
hi. i have app that im developing in my computer with vs.net 2003 (offcourse). now, this app is running in other computer in the local intranet. in the other computer i dont have vs.net installed...
5
by: ThunderMusic | last post by:
Hi, I want to find the computer name and the company name from the network indentification informations. For the computer name, I found System.Net.Dns.GetHostName(), but I fgound nothing for...
6
by: Spyder | last post by:
When you go to "MyComputer" and get properties and select "Computer Name", you get the Domain or Workgroup a computer belongs to. I have looked thru MSDN library, the Internet, the Registry and in...
1
by: Lamis | last post by:
HI, I need to install a service that changes Host Name, computer name, on all our machines. I have tried to ways: First one: static void RenameHostName() { ManagementClass mComputerSystem =...
2
by: Vincent | last post by:
I have been trying to find some API routines that will allow me to determine the name of the computer that is accessing a file on a server. I have found the NetFileEnum call (returns the names of...
7
by: =?Utf-8?B?TWljaGFlbCBkZSBWZXJh?= | last post by:
to all, I was wondering if anyone has sample code that I can use to get information about a computer in active directory. For example, I want to know the date to when a computer was joined to a...
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 working when logged in as the local computer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...
0
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,...

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.