-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Vinil
Message 4 in Discussion

Hi Vipul,
Whenever device capabilities are involved, there are at least 3 possible options.

Depending on the security settings and the O/S & N/w infrastructure, one or the other 
might not work. 

Ok, the options are:
1. Using msinfo32.exe to pipe out its report into a temp file and getting the 
appropriate stuff from that.
2. Similarly, dxdiag.exe can be used to generate a report, and can be read in ur app. 
(Or, u can use the DirectX Managed API to get the Device Capabilities)
3. Finally, a better technique is to use WMI. In .NET, WMI is available under 
System.Management Namespace (u will need to add a reference to it). The WMI service 
should be running.

E.g.:
                static void Main(string[] args)
                {
                        string strComputer = ".";
                        
                        ManagementScope mScope = new ManagementScope("winmgmts:\\" + 
strComputer + @"\root\cimv2");
                        ManagementObjectSearcher searcher = new 
                                ManagementObjectSearcher("Select * from 
Win32_SerialPort");
                        foreach (ManagementObject sPort in searcher.Get()) 
                        {
                                Console.WriteLine("Caption = " + sPort["caption"]);
                        }


Regards,
Vinil
 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to