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
在 XML Web services 发现过程中导致异常的 URL。
例外
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