FileSystem 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
該 FileSystem 模組包含用於執行檔案、目錄或資料夾及系統操作的程序。 這個 My 功能比使用 FileSystem 模組更能提升檔案 I/O 操作的生產力和效能。 如需詳細資訊,請參閱FileSystem。
public ref class FileSystem sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class FileSystem
[Microsoft.VisualBasic.CompilerServices.StandardModule]
[System.Security.SecurityCritical]
public sealed class FileSystem
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
type FileSystem = class
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
[<System.Security.SecurityCritical>]
type FileSystem = class
Public Module FileSystem
- 繼承
-
FileSystem
- 屬性
範例
此範例使用函 GetAttr 式來判定檔案及目錄或資料夾的屬性。
Dim MyAttr As FileAttribute
' Assume file TESTFILE is normal and readonly.
MyAttr = GetAttr("C:\TESTFILE.txt") ' Returns vbNormal.
' Test for normal.
If (MyAttr And FileAttribute.Normal) = FileAttribute.Normal Then
MsgBox("This file is normal.")
End If
' Test for normal and readonly.
Dim normalReadonly As FileAttribute
normalReadonly = FileAttribute.Normal Or FileAttribute.ReadOnly
If (MyAttr And normalReadonly) = normalReadonly Then
MsgBox("This file is normal and readonly.")
End If
' Assume MYDIR is a directory or folder.
MyAttr = GetAttr("C:\MYDIR")
If (MyAttr And FileAttribute.Directory) = FileAttribute.Directory Then
MsgBox("MYDIR is a directory")
End If
備註
此模組支援 Visual Basic 語言關鍵字及執行時函式庫成員,以存取檔案與資料夾。
方法
| 名稱 | Description |
|---|---|
| ChDir(String) |
變更目前的目錄或資料夾。 這個 |
| ChDrive(Char) |
改變目前的硬碟。 |
| ChDrive(String) |
改變目前的硬碟。 |
| CurDir() |
回傳一個代表當前路徑的字串。 這 FileSystem 比 . 在檔案 I/O 操作 |
| CurDir(Char) |
回傳一個代表當前路徑的字串。 這 FileSystem 比 . 在檔案 I/O 操作 |
| Dir() |
回傳一個字串,代表與特定模式或檔案屬性相符的檔案、目錄或資料夾名稱,或磁碟機的磁碟區標籤。 它 FileSystem 能讓你在檔案 I/O 操作上的生產力和效能比功能更好 |
| Dir(String, FileAttribute) |
回傳一個字串,代表與特定模式或檔案屬性相符的檔案、目錄或資料夾名稱,或磁碟機的磁碟區標籤。 它 FileSystem 能讓你在檔案 I/O 操作上的生產力和效能比功能更好 |
| EOF(Int32) |
當開啟檔案的結尾 |
| Equals(Object) |
判斷指定的 物件是否等於目前的物件。 (繼承來源 Object) |
| FileAttr(Int32) |
回傳一個枚舉,表示使用該 |
| FileClose(Int32[]) |
結束對使用函 |
| FileCopy(String, String) |
複製檔案。 這 FileSystem 比 . 在檔案 I/O 操作 |
| FileDateTime(String) |
回傳 |
| FileGet(Int32, Array, Int64, Boolean, Boolean) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Boolean, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Byte, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Char, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, DateTime, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Decimal, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Double, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Int16, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Int32, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Int64, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, Single, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, String, Int64, Boolean) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGet(Int32, ValueType, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileGetObject(Int32, Object, Int64) |
從開啟的磁碟檔案讀取資料到變數。 這個 |
| FileLen(String) |
回傳一個指定檔案長度(位元組)的值。 這個 |
| FileOpen(Int32, String, OpenMode, OpenAccess, OpenShare, Int32) |
開啟一個輸入或輸出檔案。 這個 |
| FilePut(Int32, Array, Int64, Boolean, Boolean) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Boolean, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Byte, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Char, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, DateTime, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Decimal, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Double, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Int16, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Int32, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Int64, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, Single, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, String, Int64, Boolean) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Int32, ValueType, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FilePut(Object, Object, Object) |
已淘汰.
已淘汰.
將變數的資料寫入磁碟檔案。 這個 |
| FilePutObject(Int32, Object, Int64) |
將變數的資料寫入磁碟檔案。 這個 |
| FileWidth(Int32, Int32) |
為使用 |
| FreeFile() |
回傳 |
| GetAttr(String) |
回傳 |
| GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| Input(Int32, Boolean) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Byte) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Char) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, DateTime) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Decimal) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Double) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Int16) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Int32) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Int64) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Object) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, Single) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| Input(Int32, String) |
從開啟的序列檔案讀取資料,並將資料指派給變數。 |
| InputString(Int32, Int32) |
回傳 |
| Kill(String) |
從磁碟中刪除檔案。 這個 |
| LineInput(Int32) |
從開啟的序列檔案讀取一行,並將其指派到變 |
| Loc(Int32) |
回傳一個值,指定當前開啟檔案的讀寫位置。 |
| Lock(Int32, Int64, Int64) |
控制其他程序對使用該 |
| Lock(Int32, Int64) |
控制其他程序對使用該 |
| Lock(Int32) |
控制其他程序對使用該 |
| LOF(Int32) |
回傳使用該 |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| MkDir(String) |
建立新目錄。 這個 |
| Print(Int32, Object[]) |
將顯示格式的資料寫入序列檔案。 |
| PrintLine(Int32, Object[]) |
將顯示格式的資料寫入序列檔案。 |
| Rename(String, String) |
重新命名磁碟檔案或目錄。 這個 |
| Reset() |
關閉所有使用該 |
| RmDir(String) |
移除現有的目錄。 這個 |
| Seek(Int32, Int64) |
回傳 |
| Seek(Int32) |
回傳 |
| SetAttr(String, FileAttribute) |
設定檔案的屬性資訊。 這個 |
| SPC(Int16) |
搭配 |
| TAB() |
搭配 |
| TAB(Int16) |
搭配 |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |
| Unlock(Int32, Int64, Int64) |
控制其他程序對使用該 |
| Unlock(Int32, Int64) |
控制其他程序對使用該 |
| Unlock(Int32) |
控制其他程序對使用該 |
| Write(Int32, Object[]) |
將資料寫入序列檔案。 以 寫入 |
| WriteLine(Int32, Object[]) |
將資料寫入序列檔案。 以 寫入 |