語言

OpenFileDialog.SafeFileName 屬性

定義

會取得對話框中所選檔案的檔名和副檔名。 檔案名稱中不包含路徑。

public:
 property System::String ^ SafeFileName { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public string SafeFileName { get; }
[<System.ComponentModel.Browsable(false)>]
member this.SafeFileName : string
Public ReadOnly Property SafeFileName As String

屬性值

對話框中所選檔案的檔名與副檔名。 檔案名稱中不包含路徑。 預設值為空字串。

屬性

備註

安全的檔名(僅檔名與副檔名,無路徑)可用於提升應用程式安全性,因為它不會暴露路徑資訊。 這個屬性應該能讓執行程式碼且信任有限的程式碼存取。

適用於