AuthorizationRule.Verbs 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得與資源關聯的動詞命令。
public:
property System::Collections::Specialized::StringCollection ^ Verbs { System::Collections::Specialized::StringCollection ^ get(); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.CommaDelimitedStringCollectionConverter))]
[System.Configuration.ConfigurationProperty("verbs")]
public System.Collections.Specialized.StringCollection Verbs { get; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.CommaDelimitedStringCollectionConverter))>]
[<System.Configuration.ConfigurationProperty("verbs")>]
member this.Verbs : System.Collections.Specialized.StringCollection
Public ReadOnly Property Verbs As StringCollection
屬性值
包含各種動詞命令的 StringCollection 集合,這些動詞命令的授權必須經過驗證。
- 屬性
範例
下列程式碼範例示範如何存取此屬性。
// Using the AuthorizationRuleCollection Add method.
// Set the action property.
authorizationRule.Action =
AuthorizationRuleAction.Allow;
// Define the new rule to add to the collection.
authorizationRule.Users.Add("userName");
authorizationRule.Roles.Add("admin");
authorizationRule.Verbs.Add("POST");
// Add the new rule to the collection.
authorizationSection.Rules.Add(authorizationRule);
' Using the AuthorizationRuleCollection Add method.
' Set the action property.
authorizationRule.Action = _
AuthorizationRuleAction.Allow
' Define the new rule to add to the collection.
authorizationRule.Users.Add("userName")
authorizationRule.Roles.Add("admin")
authorizationRule.Verbs.Add("POST")
' Add the new rule to the collection.
authorizationSection.Rules.Add(authorizationRule)
備註
屬性 Verbs 是以逗號分隔的 HTTP 傳輸方法清單,可授與或拒絕資源的存取權。