共用方式為


OperationFaultCollection.Add(OperationFault) 方法

定義

將指定的 OperationFault 加入至 OperationFaultCollection 的結尾。

public:
 int Add(System::Web::Services::Description::OperationFault ^ operationFaultMessage);
public int Add (System.Web.Services.Description.OperationFault operationFaultMessage);
member this.Add : System.Web.Services.Description.OperationFault -> int
Public Function Add (operationFaultMessage As OperationFault) As Integer

參數

operationFaultMessage
OperationFault

要加入至集合的 OperationFault

傳回

已加入 operationFaultMessage 參數處的以零起始的索引。

範例

OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults;
OperationFault^ myOperationFault = gcnew OperationFault;
myOperationFault->Name = "ErrorString";
myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" );
myOperationFaultCollection->Add( myOperationFault );
OperationFaultCollection myOperationFaultCollection = myOperation.Faults;
OperationFault myOperationFault = new OperationFault();
myOperationFault.Name = "ErrorString";
myOperationFault.Message = new XmlQualifiedName("s0:GetTradePriceStringFault");
myOperationFaultCollection.Add(myOperationFault);
Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults
Dim myOperationFault As New OperationFault()
myOperationFault.Name = "ErrorString"
myOperationFault.Message = New XmlQualifiedName("s0:GetTradePriceStringFault")
myOperationFaultCollection.Add(myOperationFault)

適用於