Sunday, August 26, 2012
Get computer names in the Network
7:46 AM |
Posted by
Sheen |
Edit Post
I wanted to get all the computer's names as I was doing a till balancing program, related to a supermarket (POS application). On a report I wanted to filter the daily balance.
Daily balance of all stations and station wise. I thought this might helpful, if I share the code snippet with you.
private List ComputersInNetwork()
{
List computerList= new List();
using (DirectoryEntry root = new DirectoryEntry("WinNT:"))
{
foreach (DirectoryEntry computers in root.Children)
{
foreach (DirectoryEntry computer in computers.Children)
{
if ((computer.Name != "Schema"))
{
computerList.Add(computer.Name);
}
}
}
}
computerList.Add("All");
computerList.Sort();
return list;
}
Happy coding.
Daily balance of all stations and station wise. I thought this might helpful, if I share the code snippet with you.
private List
{
List
using (DirectoryEntry root = new DirectoryEntry("WinNT:"))
{
foreach (DirectoryEntry computers in root.Children)
{
foreach (DirectoryEntry computer in computers.Children)
{
if ((computer.Name != "Schema"))
{
computerList.Add(computer.Name);
}
}
}
}
computerList.Add("All");
computerList.Sort();
return list;
}
Happy coding.
Subscribe to:
Post Comments (Atom)
Blog Archive
Important Blogs
-
-
BDD with Rails and Cucumber10 years ago
-
-
Watch Live Cricket Online Free14 years ago
-
BBC and Mahinda Rajapakshe15 years ago
-
-
0 comments:
Post a Comment