VersioningHelper.MakeVersionSafeName 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供一個版本安全的名稱。
多載
| 名稱 | Description |
|---|---|
| MakeVersionSafeName(String, ResourceScope, ResourceScope) |
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。 根據指定的資源名稱及預期的資源消耗來源,回傳一個版本安全的名稱。 |
| MakeVersionSafeName(String, ResourceScope, ResourceScope, Type) |
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。 會根據指定的資源名稱、預期的資源消耗範圍及使用該資源的類型,回傳一個版本安全的名稱。 |
MakeVersionSafeName(String, ResourceScope, ResourceScope)
根據指定的資源名稱及預期的資源消耗來源,回傳一個版本安全的名稱。
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。
public:
static System::String ^ MakeVersionSafeName(System::String ^ name, System::Runtime::Versioning::ResourceScope from, System::Runtime::Versioning::ResourceScope to);
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to);
public static string MakeVersionSafeName(string name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to);
static member MakeVersionSafeName : string * System.Runtime.Versioning.ResourceScope * System.Runtime.Versioning.ResourceScope -> string
Public Shared Function MakeVersionSafeName (name As String, from As ResourceScope, to As ResourceScope) As String
參數
- name
- String
資源名稱。
- from
- ResourceScope
資源的範圍。
期望的資源消耗範圍。
傳回
一個版本安全的名稱。
備註
原始名稱會加上與範圍相關的後綴。 後綴可包含程序身份、當前 AppDomain 身份,或兩者兼具。
適用於
MakeVersionSafeName(String, ResourceScope, ResourceScope, Type)
會根據指定的資源名稱、預期的資源消耗範圍及使用該資源的類型,回傳一個版本安全的名稱。
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。
public:
static System::String ^ MakeVersionSafeName(System::String ^ name, System::Runtime::Versioning::ResourceScope from, System::Runtime::Versioning::ResourceScope to, Type ^ type);
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to, Type? type);
public static string MakeVersionSafeName(string name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to, Type type);
static member MakeVersionSafeName : string * System.Runtime.Versioning.ResourceScope * System.Runtime.Versioning.ResourceScope * Type -> string
Public Shared Function MakeVersionSafeName (name As String, from As ResourceScope, to As ResourceScope, type As Type) As String
參數
- name
- String
資源名稱。
- from
- ResourceScope
瞄準鏡範圍的起點。
瞄準鏡範圍的末端。
傳回
一個版本安全的名稱。
例外狀況
和 from 的to值是無效的。 列舉中的 ResourceScope 資源類型正從較為限制的資源類型轉變為更通用的資源類型。
type 是 null。
備註
原始名稱會加上與範圍相關的後綴。