Drive Extra Info

Unknown | 5:22 AM |

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for Window5.xaml
    /// </summary>
    public partial class Window5 : Window
    {
        public Window5()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DriveInfo[] strdrives = DriveInfo.GetDrives();
            foreach (DriveInfo strdrive in strdrives)
            {
                listBox1.Items.Add(string.Format("Drive{0}",strdrive.Name));
                listBox1.Items.Add(string.Format("File type:{0}",strdrive.DriveType));
                listBox1.Items.Add(string.Format("Volume Label:{0}", strdrive.VolumeLabel));
                listBox1.Items.Add(string.Format("File System:{0}", strdrive.DriveFormat));
                listBox1.Items.Add(string.Format("Available space to current user:{0,15}bytes", strdrive.AvailableFreeSpace));
                listBox1.Items.Add(string.Format("Total available space:{0,15}bytes", strdrive.TotalFreeSpace));
                listBox1.Items.Add(string.Format("Total size of drive:{0,15}bytes", strdrive.TotalSize));


            }
        }
    }
}

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....