總網頁瀏覽量

2011年10月18日 星期二

[VB.NET] 取得所有磁碟清單


'利用VB.net內建函數取得可用磁碟清單
'GetDrives
Imports System.IO
Module Module1
     Sub Main()
           Dim drives() as string = Directory.GetLogicalDrives()
           Console.WriteLine("可以使用的磁碟機")
           For Each s As String In drives
               Console.WriteLine(s)
           Next s
     End Sub
End Module

沒有留言:

張貼留言