SoapHeaderCollection.Insert(Int32, SoapHeader) Méthode

Définition

Insère un élément SoapHeader dans SoapHeaderCollection à l'index spécifié.

public:
 void Insert(int index, System::Web::Services::Protocols::SoapHeader ^ header);
public void Insert (int index, System.Web.Services.Protocols.SoapHeader header);
member this.Insert : int * System.Web.Services.Protocols.SoapHeader -> unit
Public Sub Insert (index As Integer, header As SoapHeader)

Paramètres

index
Int32

Index de base zéro au niveau duquel insérer SoapHeader dans SoapHeaderCollection.

header
SoapHeader

Le SoapHeader à insérer dans le SoapHeaderCollection.

Exceptions

Le paramètre index n’est pas un index valide dans SoapHeaderCollection.

Exemples

mySoapHeader = gcnew MySoapHeader;
mySoapHeader->text = "This header is inserted before the first header";
mySoapHeaderCollection->Insert( 0, mySoapHeader );
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This header is inserted before the first header"
mySoapHeaderCollection.Insert(0, mySoapHeader)

Remarques

Si le index paramètre est égal au nombre d’éléments de la collection, celui-ci SoapHeader est ajouté à la fin de la collection.

Éléments SoapHeader après le déplacement du point d’insertion vers le bas pour prendre en charge le nouvel élément.

S’applique à

Voir aussi