Can I list all the computers which is in network which starts with particular name? e.g. suppose below given computers are shared in network- (keyboard, monitor, monitor1, monitor235, PC6, keyboard2, PC8, PC6, PC2)
I am using below code to list all the computers in network-
List<string> list = new List<string>();
using (DirectoryEntry root = new DirectoryEntry("WinNT:"))
{
foreach (DirectoryEntry computers in root.Children)
{
foreach (DirectoryEntry computer in computers.Children)
{
if ((computer.Name != "Schema"))
{
list.Add(computer.Name);
}
}
}
}
can I list all the PC which starts with name "PC"? i.e PC6, PC8, PC2