vortiant.blogg.se

Vb.net quick disk format
Vb.net quick disk format





vb.net quick disk format

We then determine each drive’s given name and add it to our listbox. We make use of a For Each loop to loop through all the Fixed Drives (hard drives).

vb.net quick disk format

'Enable Defrag Button If Current User Is Logged In As AdminītnDefrag.Enabled = My.User.IsInRole() (String.Format(" ( NO NAME )", diDrive.Name)) If diDrive.VolumeLabel String.Empty Then 'If Drive Has A "Name"

vb.net quick disk format

If diDrive.DriveType = DriveType.Fixed Then 'Is it a HD? LstDrives will hold all the drives present on the system, and arrDrives will host the result of some string manipulation, which ultimately provides the current drive string, for example: C:\Īdd the Form_Load event: Private Sub frmDefrag_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadįor Each diDrive As DriveInfo In DriveInfo.GetDrives 'Get all Hard Drives Connected To PC Private arrDrives As String() 'Array of Drives Obviously, you can name the objects as you please, but keep in mind that my names for the objects may be different than yours.Īdd the next Namespace: Imports System.IO 'File Input / OutputĪdd the following 2 Modular variables: Private lstDrives As New List(Of String) 'List of Drives Open Visual Studio and start a new VB.NET Windows Forms application. With today’s project we will learn very quick ways to defragment our harddrives.

VB.NET QUICK DISK FORMAT HOW TO

Today we will learn how to quickly defrag your hard disks. Technically, it can be, but with the use of Windows Method Instrumentation ( WMI ), it shouldn’t be, because we don’t have to reinvent the wheel. When getting the idea for this article, I thought it would be a lot of work. Sometimes however, like today it is a big surprise.







Vb.net quick disk format