共用方式為


LoadTestContext.Item 屬性

取得或設定具有指定之索引鍵的 LoadTestContext 項目。

命名空間:  Microsoft.VisualStudio.TestTools.LoadTesting
組件:  Microsoft.VisualStudio.QualityTools.LoadTestFramework (在 Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll 中)

語法

'宣告
Public Default Property Item ( _
    key As String _
) As Object
public Object this[
    string key
] { get; set; }
public:
virtual property Object^ default[String^ key] {
    Object^ get (String^ key) sealed;
    void set (String^ key, Object^ value) sealed;
}
abstract Item : 
        key:string -> Object with get, set
override Item : 
        key:string -> Object with get, set
JScript 不支援索引屬性。

參數

  • key
    型別:System.String
    要取得或設定之項目的索引鍵。

屬性值

型別:System.Object
具有指定索引鍵的項目。

實作

IDictionary<TKey, TValue>.Item

例外狀況

例外狀況 條件
ArgumentNullException

key 為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

KeyNotFoundException

屬性已擷取,並且找不到 key。

NotSupportedException

屬性已設定,而且 LoadTestContext 是唯讀的。

.NET Framework 安全性

請參閱

參考

LoadTestContext 類別

Microsoft.VisualStudio.TestTools.LoadTesting 命名空間