I cant get access to "DriveInfo". I added "Using System.IO;"
Do you have any clue why I cant get access to "DriveInfo"
public long GetTotalFreeSpace(string driveName)
{
foreach (DriveInfo drive in DriveInfo.GetDrives())
{
if (drive.IsReady && drive.Name == driveName)
{
return label.TotalFreeSpace;
}
}
return -1;
}
Loading

VulpesRank #55 · 29.2K reputationPosted Aug 14, 2011, 12:34 AM EDT
http://www.codeproject.com/KB/silverlight/FileExplorerInSilverlight.aspx
David SmithRank #999 · 2K reputationPosted Aug 14, 2011, 3:22 AM EDT
I can't get pass this line for some reason below within my project. When I run the project from codeproject it passes the line.
dynamic fileSystem = AutomationFactory.CreateObject("Scripting.FileSystemObject");
VulpesRank #55 · 29.2K reputationPosted Aug 14, 2011, 3:34 AM EDT
To use 'dynamic' you need .NET 4.0 which I assume you're using.
To use the AutomationFactory class, you need this using directive in your program:
using System.Runtime.InteropServices.Automation;
David SmithRank #999 · 2K reputationPosted Aug 14, 2011, 12:39 PM EDT
I rebooted my computer and for some reason it just work. Its weird. lol. Let me troubleshoot somemore. How do you turn off RIA services. For some reason if i got asp.net default form as a start up project. It will not work. But if i am running RIA services it works fine.
The error i am getting is this operation is not supported in the current context
VulpesRank #55 · 29.2K reputationPosted Aug 14, 2011, 1:05 PM EDT
David SmithRank #999 · 2K reputationPosted Aug 14, 2011, 5:37 PM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 15, 2011, 7:27 AM EDT
David SmithRank #999 · 2K reputationPosted Aug 15, 2011, 8:20 PM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 16, 2011, 1:06 AM EDT