Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Get NetBIOS and DNS computer names
SUBMITTED BY:
Guest
DATE:
Dec. 7, 2013, 4:12 p.m.
FORMAT:
C#
SIZE:
411 Bytes
Raw
Download
Tweet
HITS:
55175
Go to comments
Report
Get
NetBIOS
and
DNS
computer
names
using
System
;
static
string
GetLocalHostName
()
{
string
netBiosName
=
System
.
Environment
.
MachineName
;
//return netBiosName;
// Following method is deprecated
// string dnsName =
// System.Net.Dns.GetHostByName("LocalHost").HostName;
string
dnsName
=
System
.
Net
.
Dns
.
GetHostName
();
return
dnsName
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus