語言

Assembly.GetFile(String) 方法

定義

在該組裝清單的檔案表中,會取得指定檔案的 a FileStream 。

public:
 virtual System::IO::FileStream ^ GetFile(System::String ^ name);
public virtual System.IO.FileStream? GetFile(string name);
public virtual System.IO.FileStream GetFile(string name);
abstract member GetFile : string -> System.IO.FileStream
override this.GetFile : string -> System.IO.FileStream
Public Overridable Function GetFile (name As String) As FileStream

參數

name
String

指定檔案的名稱。 請不要包含檔案的路徑。

傳回

包含指定檔案的串流,或 null 若找不到該檔案。

實作

例外狀況

找到的檔案無法載入。

參數 name 為 null。

參數 name 為空字串(“”)。

name 未被找到。

name 不是一個有效的組裝。

備註

此方法適用於公開與私有資源檔案。

name參數不應包含檔案的路徑。

在 .NET 5 及以後版本中,對於捆綁組譯,此方法會拋出例外。

適用於