元編程參考文件

作業系統

穩定

檔案、資料夾與路徑,主控台,位元組資料,以及本機系統資訊

Methodox Wiki 上的使用指南

7 個類別,共 209 個節點

所屬發行版
元編程(教育版)元編程(專業版)
支援等級
第 1 級(擬定)
所屬包
平臺
平臺

檔案、路徑、主控台、程序與執行環境,以及針對目前文件的超象程式設計:執行圖與展開物件屬性。

檔案系統

追加所有行將行追加到檔案中, optionally 使用指定的編碼,然後關閉檔案。追加文字將指定的字串附加到檔案中,如果檔案不存在則建立該檔案,可以選擇使用指定的編碼。追加文字建立一個 StreamWriter,用於將 UTF-8 編碼的文字追加到現有檔案,如果指定的檔案不存在,則建立一個新檔案。更改副檔名複製複製一個現有檔案到一個新檔案。建立檔案在指定路徑中建立或截斷並覆蓋一個檔案,選擇性地指定緩衝區大小和描述如何建立或覆蓋檔案的選項。建立目錄建立指定路徑中所有目錄和子目錄,除非它們已經存在。建立目錄符號連結建立一個由路徑標識的目錄符號連結,該連結指向目標路徑。建立檔案符號連結建立一個由路徑標識的檔案符號連結,指向 pathToTarget。建立符號連結建立檔案或目錄的符號連結建立臨時子目錄在目前使用者的臨時目錄中建立一個唯一命名的空目錄。建立文字檔案建立或開啟一個檔案以寫入 UTF-8 編碼的文字。解碼 Base64將 Base64 字串表示解碼為位元組陣列。解密檔案使用給定的金鑰通過 Encrypt(string path, string key) 方法解密加密檔案。刪除刪除檔案或目錄刪除目錄從指定路徑刪除一個空目錄。刪除檔案刪除指定的檔案。目錄是否存在確定給定路徑是否指向磁碟上的現有目錄。編碼二進位制檔案為Base64使用 Base64 字串表示法對二進位制檔案進行編碼。加密檔案使用特定金鑰加密檔案;要解密,請使用相同的金鑰。列舉目錄返回指定路徑下的目錄全名的可列舉集合。列舉檔案返回指定路徑中的完整檔名的可列舉集合。列舉檔案系統條目返回指定路徑中的檔名和目錄名的可列舉集合。檔案是否存在確定指定的檔案是否存在。取得應用資料檔案取得應用資料資料夾取得檔案屬性取得指定路徑檔案的 FileAttributes。取得建立時間返回指定檔案或目錄的建立日期和時間。取得建立時間(UTC)返回指定檔案或目錄的建立日期和時間(協調世界時 UTC)。取得目前目錄取得應用程式的目前工作目錄。取得目錄返回指定目錄中子目錄的名稱(包括它們的路徑)。取得目錄根返回指定路徑的卷資訊、根資訊或兩者。取得檔案的MD5取得檔案的MD5字串表示取得檔案返回指定目錄中檔案的名稱(包括它們的路徑)。取得檔案系統條目返回指定路徑中所有檔案和子目錄的名稱。取得最後存取時間返回指定檔案或目錄最後存取的日期和時間。取得上次存取時間(UTC)返回指定檔案或目錄上次存取的日期和時間(協調世界時 UTC)。取得最後寫入時間返回指定檔案或目錄最後寫入的日期和時間。取得最後寫入時間(UTC)返回指定檔案或目錄最後寫入的協調世界時(UTC)日期和時間。取得邏輯驅動器檢索此電腦上邏輯驅動器的名稱,形式為"<驅動器字母>:\"。取得父目錄檢索指定路徑的父目錄,包括絕對路徑和相對路徑。取得特殊資料夾中的路徑取得特殊資料夾取得臨時檔案路徑在磁碟上建立一個唯一命名的零位元組臨時檔案,並返回該檔案的完整路徑。取得臨時資料夾路徑取得臨時資料夾路徑,並可以選擇性地建立該資料夾。取得工作目錄移動移動檔案或目錄到新路徑移動目錄移動檔案或目錄及其內容到新位置。移動檔案移動指定的檔案到新位置並更改檔名,如果目標檔案已存在,可以選擇替換。開啟檔案開啟指定路徑的FileStream,並使用指定模式(預設的讀/寫存取)。開啟讀取開啟一個現有的檔案以進行讀取。開啟文字檔案開啟一個現有的 UTF-8 編碼文字檔案以進行讀取。開啟寫入開啟一個現有檔案或建立一個新檔案以進行寫入。讀取所有位元組開啟一個二進位制檔案,將檔案內容讀取到位元組陣列中,然後關閉該檔案。讀取所有行開啟一個檔案,讀取檔案的所有行,可選地使用指定的編碼,然後關閉檔案。讀取所有文字開啟一個檔案,讀取檔案中的所有文字,選定使用指定的編碼(Encoding),然後關閉檔案。讀取檔案行讀取檔案的行,選用指定的編碼(可選)。重新命名檔案替換檔案用另一個檔案的內容替換指定檔案的內容,刪除原始檔案,並建立被替換檔案的備份,選項上可以忽略合併錯誤。解析目錄連結目標取得指定目錄連結的目標。解析檔案連結目標取得指定檔案連結的目標。解析連結目標解析符號連結到檔案或目錄設定屬性設定指定路徑上檔案的指定檔案屬性。設定建立時間設定檔案建立的日期和時間。設定建立時間 UTC設定檔案建立的日期和時間(以協調世界時 UTC 表示)。設定目前工作目錄設定應用程式的目前工作目錄為指定的目錄。設定最後存取時間設定指定檔案的最後存取日期和時間。設定最後存取時間 UTC設定指定檔案最後存取的日期和時間(以協調世界時 UTC 顯示)。設定最後寫入時間設定指定檔案的最後寫入日期和時間。設定最後寫入時間(UTC)設定指定檔案的最後寫入時間(以協調世界時間 UTC 表示)。設定工作目錄快速建立空檔案在指定路徑中建立檔案,或者截斷並覆蓋檔案,具有可選大小(對於非文字檔案)。寫入所有位元組建立一個新檔案,將指定的位元組陣列寫入檔案中,然後關閉檔案。寫入所有行建立一個新檔案,將字串集合寫入檔案,然後關閉檔案,預設使用UTF8編碼(可選地指定其他編碼)。寫文字到檔案建立一個新檔案,將指定的字串寫入檔案,然後關閉檔案,可選地使用指定的編碼。

輸入緩衝區

複製緩衝區Returns a self-contained immutable copy of this buffer.相等Determines whether this buffer has the same visible bytes as another buffer.位元組Gets an enumerable over the visible bytes in this immutable byte array.位元組序Gets the byte order used by numeric read operations.是否為空Gets a value indicating whether this immutable byte array contains no bytes.位元組Gets the byte at the specified zero-based index.長度Gets the number of bytes visible in this immutable byte array.文字編碼Gets the encoding used by string read operations.取得列舉器Returns an enumerator over the visible bytes.取得雜湊碼Gets a hash code based on the visible bytes.讀取真否Reads a Boolean and returns the remaining bytes.在偏移處讀取真否Reads a Boolean at an explicit offset without consuming bytes.讀取位元組Reads a byte and returns the remaining bytes.讀取多個位元組Reads bytes from the beginning of this buffer and returns the remaining bytes.在偏移處讀取多個位元組Reads bytes at an explicit offset without consuming bytes.在偏移處讀取位元組Reads a byte at an explicit offset without consuming bytes.讀取數字Reads a 64-bit floating-point value and returns the remaining bytes.在偏移處讀取數字Reads a 64-bit floating-point value at an explicit offset without consuming bytes.讀取低精度數字Reads a 32-bit floating-point value and returns the remaining bytes.在偏移處讀取低精度數字Reads a 32-bit floating-point value at an explicit offset without consuming bytes.讀取 GUIDReads a GUID and returns the remaining bytes.在偏移處讀取 GUIDReads a GUID at an explicit offset without consuming bytes.讀取整數Reads a 32-bit signed integer and returns the remaining bytes.在偏移處讀取整數Reads a 32-bit signed integer at an explicit offset without consuming bytes.讀取大整數Reads a 64-bit signed integer and returns the remaining bytes.在偏移處讀取大整數Reads a 64-bit signed integer at an explicit offset without consuming bytes.讀取有符號位元組Reads a signed byte and returns the remaining bytes.在偏移處讀取有符號位元組Reads a signed byte at an explicit offset without consuming bytes.讀取小整數Reads a 16-bit signed integer and returns the remaining bytes.在偏移處讀取小整數Reads a 16-bit signed integer at an explicit offset without consuming bytes.讀取文字Reads a fixed-size string from the beginning of this buffer and returns the remaining bytes.在偏移處讀取文字Reads a fixed-size string at an explicit offset without consuming bytes.讀取正整數Reads a 32-bit unsigned integer and returns the remaining bytes.在偏移處讀取正整數Reads a 32-bit unsigned integer at an explicit offset without consuming bytes.讀取大正整數Reads a 64-bit unsigned integer and returns the remaining bytes.在偏移處讀取大正整數Reads a 64-bit unsigned integer at an explicit offset without consuming bytes.讀取小正整數Reads a 16-bit unsigned integer and returns the remaining bytes.在偏移處讀取小正整數Reads a 16-bit unsigned integer at an explicit offset without consuming bytes.跳過Skips a number of bytes and returns the remaining bytes.切片Returns a slice of this immutable byte array.轉為陣列Returns a copy of the visible bytes.轉為文字Returns a hexadecimal preview of this buffer.設定位元組序Returns a new immutable byte array with the same bytes but a different numeric byte order.設定文字編碼Returns a new immutable byte array with the same bytes but a different string encoding.從陣列建立Creates an immutable byte array from a byte array by copying its contents.從檔案建立Reads all bytes from a file into a new immutable byte array.從流建立Reads all bytes from a stream into a new immutable byte array.空緩衝區Gets an empty immutable byte array.

輸出緩衝區

輸出緩衝區Creates a new immutable constructive byte array.清空Returns an empty buffer using the same settings.相等Determines whether this object contains the same bytes as another immutable constructive byte array.位元組序Gets the byte order used by numeric write operations.是否為空Gets whether this buffer contains no bytes.長度Gets the number of bytes currently written.文字編碼Gets the encoding used by string write operations.取得雜湊碼Returns a hash code based on the current bytes.儲存Saves the current bytes to a file.轉為陣列Returns a copy of the current bytes.轉為文字Returns a hexadecimal preview of the current bytes.設定位元組序Returns a copy with a different numeric byte order.設定文字編碼Returns a copy with a different string encoding.寫入真否寫入一個真否值,佔一個位元組。寫入位元組寫入一個位元組。寫入多個位元組Writes empty zero padding.寫入數字寫入一個 64 位浮點數。寫入低精度數字寫入一個 32 位浮點數。寫入 GUID按 Guid.ToByteArray() 在執行時的位元組表示寫入一個 GUID。寫入整數寫入一個 32 位有符號整數。寫入大整數寫入一個 64 位有符號整數。寫入有符號位元組寫入一個有符號位元組。寫入小整數寫入一個 16 位有符號整數。寫入定長文字Writes a fixed-size string using exactly the encoded byte count of Value.寫入以零結尾的文字Writes a zero-terminated string.寫入正整數寫入一個 32 位無符號整數。寫入大正整數寫入一個 64 位無符號整數。寫入小正整數寫入一個 16 位無符號整數。空緩衝區Gets an empty immutable constructive byte array.

路徑

可變位元組陣列構建器

主控台

執行時環境