availablefreespace
indicates the amount of available free space on a drive.(配額考慮在內)
driveformat
gets the name of the file system, such as ntfs or fat32.
drivetype
gets the drive type.
isready
gets information on whether or not the drive is ready.
name
gets the name of the drive.
rootdirectory
gets the root directory of the drive.
totalfreespace
gets the total amount of free space available on a drive.
totalsize
gets the total size of storage space on the drive.
volumelabel
gets and sets the volume label of the drive.上面的volumelabel是可讀寫的,其他屬性是只讀的。在使用時一般需先判斷isready屬性是否為true,如果沒有準備好,那訪問其他屬性就會發生異常,還有需要注意在編程時是否有權限訪問。drivetype枚舉也是在.net 2.0下新增的,
member name
description
cdrom
the drive is a cd rom device.
fixed
the drive is a fixed disk.(固定磁盤驅動器)
network
the drive is a network drive.(網絡驅動器)
norootdirectory
the drive does not have a root directory.(不含根目錄的驅動器)
ram
the drive is a ram disk.(ram閃存)
removable
the drive is a removable storage device.(可移動存儲設備)
unknown
the type of drive is unknown.(未知設備類型)在1.1版中使用directory.getlogicaldrives();來得到驅動器。當然使用wmi也可以實現上述所有功能。 4.system.windows.forms.menu類在2.0中增加了tag屬性,這樣從它繼承的menuitem也就包含了該屬性,就像treenode.tag屬性可以保存各種對象。 5.console類明顯得到增強consle增加了很多功能,包括設置控制臺窗體的外觀大小和顏色,還可以設置、移動里面的光標,設置緩沖區,判斷鍵盤的那些特定鍵是否開啟等等。舉個例子像console.readkey ()以及它的重載方法將會很有用。 以上特征是我針對.net framework 2.0 beta 2來寫的,在正式版出來后也許會有些改動。
|
新聞熱點
疑難解答
圖片精選