FileDialog.SafeFileName 屬性

定義

會得到一個只包含所選檔案檔名的字串。

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

屬性值

String A 只包含所選檔案的檔名。 預設值為 Empty,當未選擇檔案或選擇目錄時,這也是該值。

屬性

備註

這個值是移除所有路徑資訊後的值 FileName 。 移除路徑使該值適合部分信任應用,因為這會防止應用程式發現本地檔案系統的資訊。

若選取多個檔案名稱(長度 SafeFileNames 大於一個),則此特性僅包含第一個選擇的檔案名稱。

適用於