共用方式為


CorsOptions.GetPolicy(String) 方法

定義

根據 取得原則 name

public:
 Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^ GetPolicy(System::String ^ name);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy GetPolicy (string name);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy? GetPolicy (string name);
member this.GetPolicy : string -> Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy
Public Function GetPolicy (name As String) As CorsPolicy

參數

name
String

要查閱的原則名稱。

傳回

CorsPolicy如果已新增原則,則為 。否則為 null

適用於