-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vikram4891
Message 3 in Discussion
Hi mrinal,
Thank you v much for ur replies.
I have yet another problem .
I am getting an error "User credentials cannot be used for local connections"
i am pasting my code 2 .Please help me out.
// Connection credentials to the remote computer -
// not needed if the logged in account has access
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "administrator";
oConn.Password = "listenn";
System.Management.ManagementScope oMs = new
System.Management.ManagementScope("\\promac12", oConn);
//get Fixed disk stats
System.Management.ObjectQuery oQuery = new
System.Management.ObjectQuery("select FreeSpace,Size,Name from
Win32_LogicalDisk");
//Execute the query
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs,oQuery);
//Get the results
ManagementObjectCollection oReturnCollection = oSearcher.Get();
//loop through found drives and write out info
foreach( ManagementObject oReturn in oReturnCollection )
{
// Disk name
Console.WriteLine("Name : " + oReturn["Name"].ToString());
// Free Space in bytes
Console.WriteLine("FreeSpace: " + oReturn["FreeSpace"].ToString());
// Size in bytes
Console.WriteLine("Size: " + oReturn["Size"].ToString());
}
Thank You
Vicky
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_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]