VB.Net by API/System.IO/DriveInfo

Материал из VB Эксперт
Перейти к: навигация, поиск

DriveInfo.AvailableFreeSpace()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.RootDirectory.ToString)
            If drive_info.IsReady() Then
                Console.WriteLine( drive_info.AvailableFreeSpace().ToString)
            End If
        Next drive_info
   End Sub 
End Class


DriveInfo.DriveFormat()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.RootDirectory.ToString)
            If drive_info.IsReady() Then
                Console.WriteLine( drive_info.DriveFormat())
            End If
        Next drive_info
   End Sub 
End Class


DriveInfo.DriveType()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.DriveType().ToString)
        Next drive_info
   End Sub 
End Class


DriveInfo.GetDrives()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.WriteLine(drive_info.Name)
        Next drive_info
   End Sub 
End Class


DriveInfo.IsReady()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.IsReady().ToString)
        Next drive_info
   End Sub 
End Class


DriveInfo.Name

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.WriteLine(drive_info.Name)
        Next drive_info
   End Sub 
End Class


DriveInfo.RootDirectory

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.RootDirectory.ToString)
        Next drive_info
   End Sub 
End Class


DriveInfo.TotalFreeSpace()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.RootDirectory.ToString)
            If drive_info.IsReady() Then
                Console.WriteLine( drive_info.TotalFreeSpace().ToString)
            End If
        Next drive_info
   End Sub 
End Class


DriveInfo.VolumeLabel()

  
Imports System
Imports System.IO

Public Class MainClass
   Shared Sub Main()
        For Each drive_info As DriveInfo In DriveInfo.GetDrives()
            Console.Write(drive_info.Name & "   " )
            Console.WriteLine(drive_info.RootDirectory.ToString)
            If drive_info.IsReady() Then
                Console.WriteLine( drive_info.VolumeLabel())
            End If
        Next drive_info
   End Sub 
End Class