I am doing one disk management application. I can take out the discs that have been created. The main problem is to see what has not been created. And to make them unit and shape. I do not want to use Windows's disk management application. What should I do for this? What I do is almost identical to the Windows Disk Management application.
I have tried with WMI and Drive Info but I can not see disks that have not been created yet.
Here is what I've alredy tried :
DataTable dt = new DataTable();
dt.Clear();
dt.Columns.Add("Name");
dt.Columns.Add("Volume Label");
dt.Columns.Add("Type");
dt.Columns.Add("Size");
dt.Columns.Add("Format");
dt.Columns.Add("Status");
dt.Columns.Add("Free Space");
dt.Columns.Add("Byte");
DriveInfo[] driverslist = DriveInfo.GetDrives();
foreach (DriveInfo d in driverslist)
{
if (d.IsReady == true)
{
size = FormatBytes(Convert.ToInt64(d.TotalSize));
totalfreesize = FormatBytes(Convert.ToInt64(d.TotalFreeSpace));
dt.Rows.Add(d.Name, d.VolumeLabel, d.DriveType, size, d.DriveFormat, d.IsReady, totalfreesize, d.TotalSize);
}
}
dataGrid.ItemsSource = dt.DefaultView;
I pull the harddisks in here and transfer them to the table.