Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 19623 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > Windows Forms > Find Driver Details in VB.NET ...
Santosh4u

Find Driver Details in VB.NET

 Code Snippet posted by: Santosh4u | Posted on: 10/26/2009 | Category: Windows Forms Codes | Views: 1758 | Status: [Member] | Alert Moderator   
Ads

Below Code will Help you to Find the Driver Details of your System.
VB.NET
For Each objdriveinfo As DriveInfo In DriveInfo.GetDrives()

If objdriveinfo.Name = "A:\" Or objdriveinfo.Name = "G:\" Then
Else
ListBox1.Items.Add(objdriveinfo.Name & " " & System.Math.Round((objdriveinfo.TotalFreeSpace /
1073741824), 2) & "GB" & " " & System.Math.Round((objdriveinfo.TotalSize / 1073741824), 2) & "GB" &
" " & objdriveinfo.DriveFormat & " " & objdriveinfo.VolumeLabel & "")
End If
Next

C#.NET
 foreach (DriveInfo objdriveinfo in DriveInfo.GetDrives())

{
if (objdriveinfo.Name == "A:\\" || objdriveinfo.Name == "G:\\")
{
}
else
{
ListBox1.Items.Add(objdriveinfo.Name + " " + System.Math.Round((Double)
(objdriveinfo.TotalFreeSpace / 1073741824), 2) + "GB" + " " + System.Math.Round((Double)
(objdriveinfo.TotalSize / 1073741824), 2) + "GB" + " " + objdriveinfo.DriveFormat + " "
+ objdriveinfo.VolumeLabel + "");
}

}

Regards
Santosh
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 9:05:08 PM