TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
manjulasd
NA
1
0
List down all computer names in a Network
Nov 3 2003 4:18 AM
I want to list all computer names in the Domain. I have try with WMI but it return a error, "query invalid". Code as follows, If you have any idea, pls let me know. Thanks Manjula using System; using System.Management; class NetworkComputerTest { public static void Main() { try { ManagementObjectSearcher query = new ManagementObjectSearcher("root\\cimv2", "Select * From Win32_NetworkConnection WHERE Domain= sscomp" ) ; ManagementObjectCollection queryCollection = query.Get(); foreach( ManagementObject mobject in queryCollection ) { string name = (string)mobject["Name"]; Console.WriteLine( "Name '{0}'", name); } } catch(Exception e) { Console.WriteLine(e.Message); } Console.ReadLine(); } }
Reply
Answers (
0
)
where to declare webmethod for abstract class .. ??
keystrokes under windows