DiscoveryExceptionDictionary.Add(String, Exception) Méthode

Définition

Ajoute une Exception clé avec la urlvaleur 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)

Paramètres

url
String

URL qui a provoqué une exception pendant la découverte des services Web XML.

value
Exception

Qui Exception s’est produit lors de la découverte des services Web XML.

Exceptions

url a la valeur null.

Une entrée avec une clé existe url déjà dans le DiscoveryExceptionDictionary.

Exemples

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

S’applique à

Voir aussi