DiscoveryExceptionDictionary.Add(String, Exception) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將具有 url
的索引鍵的 Exception 加入至 DiscoveryExceptionDictionary。
public:
void Add(System::String ^ url, Exception ^ value);
public void Add (string url, Exception value);
member this.Add : string * Exception -> unit
Public Sub Add (url As String, value As Exception)
參數
- url
- String
URL,在 XML Web Service 探索期間造成例外狀況。
例外狀況
url
為 null
。
具有 url
的索引鍵的項目已經存在於 DiscoveryExceptionDictionary 中。
範例
DiscoveryExceptionDictionary^ myNewExceptionDictionary = gcnew DiscoveryExceptionDictionary;
// Add an exception with the custom error message.
Exception^ myNewException = gcnew Exception( "The requested service is not available." );
myNewExceptionDictionary->Add( myUrlKey, myNewException );
myExceptionDictionary = myNewExceptionDictionary;
DiscoveryExceptionDictionary myNewExceptionDictionary =
new DiscoveryExceptionDictionary();
// Add an exception with the custom error message.
Exception myNewException =
new Exception("The requested service is not available.");
myNewExceptionDictionary.Add(myUrlKey, myNewException);
myExceptionDictionary = myNewExceptionDictionary;
Dim myNewExceptionDictionary As New DiscoveryExceptionDictionary()
' Add an exception with the custom error message.
Dim myNewException As New Exception("The requested service is not available.")
myNewExceptionDictionary.Add(myUrlKey, myNewException)
myExceptionDictionary = myNewExceptionDictionary