Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi
how to use getcomputername in C# , with any header file ?
Posted
Comments
Sergey Alexandrovich Kryukov 19-Jan-12 16:47pm    
Where did you find this "getcomputername"?
--SA
Dave Kreskowiak 19-Jan-12 23:09pm    
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx

use the following code:

C#
using System.Net;
string hostName = Dns.GetHostName();
 
Share this answer
 
Hi , i want api function ( for example getcomputername ) call in c#.net but i don't know , how i do ?
 
Share this answer
 
Why couldn't you just use Environment.MachineName[^]??
 
Share this answer
 
Comments
Uday P.Singh 19-Jan-12 13:58pm    
5ed :)
NeptuneHACK! 19-Jan-12 15:19pm    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900