語言

SoapHeaderCollection.Add(SoapHeader) 方法

定義

將 SoapHeader 加入至 SoapHeaderCollection。

public:
 int Add(System::Web::Services::Protocols::SoapHeader ^ header);
public int Add(System.Web.Services.Protocols.SoapHeader header);
member this.Add : System.Web.Services.Protocols.SoapHeader -> int
Public Function Add (header As SoapHeader) As Integer

參數

header
SoapHeader

該 SoapHeader 要加到 SoapHeaderCollection。

傳回

插入的位置 SoapHeader 。

範例

mySoapHeader = gcnew MySoapHeader;
mySoapHeader->text = "This is the second SOAP header";
mySoapHeaderCollection->Add( mySoapHeader );
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This is the second SOAP header";
mySoapHeaderCollection.Add(mySoapHeader);
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This is the second SOAP header"
mySoapHeaderCollection.Add(mySoapHeader)

適用於

另請參閱