formating a slave drive with c#

I have been looking around for this question for so long. Does anyone know how to access a slave drive or network drive through C# to format it?
[144 byte] By [MattSipes] at [2007-12-16]
# 2
I don't want to have to import a shell dll file and use unmanaged code. ANy other way?
MattSipes at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...
# 3

Ultimately, whoever writes the wrapper will have to call the Unmanaged code.

VijayeRaji at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...
# 4
There's got to be another way. Any way with using GetLogicalDrives?
MattSipes at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...
# 5
Okay here is another question then. Is there a way that I can just erase directories on the drive with 1 button. Do I have to access System.IO.File? Or use maybe WMI abilities?
MattSipes at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...
# 6

/// <summary>
/// Removes all the content of a directory but not the directory itself
/// </summary>
/// <param name="LOCATION">The directory of which you want to remove the contents</param>
public void RemoveAll(string LOCATION)
{
string DIR = LOCATION;
if (DIR.Length == 1)
{
DIR += @":\";
}
else if (!DIR.EndsWith(@"\"))
{
DIR += @"\";
}
try
{
System.IO.DirectoryInfo DI = new System.IO.DirectoryInfo(DIR);
foreach (System.IO.FileInfo f in DI.GetFiles())
{
try
{
f.Delete();
}
catch
{
}
}
foreach (System.IO.DirectoryInfo d in DI.GetDirectories())
{
try
{
d.Delete(true);
}
catch
{
}
}
}
catch { }
}

Kaetemi at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...
# 7
We figured that one out on the "erase network drive". Thanks for the post though!
MattSipes at 2007-9-8 > top of Msdn Tech,Visual C#,Visual C# General...