0
這是結構類創建
public struct Biller
{
public string BillerTag { get; set; }
public string Description { get; set; }
public string FirstField { get; set; }
public string FirstFieldFormat { get; set; }
public string FirstFieldWidth { get; set; }
public string SecondField { get; set; }
public string SecondFieldFormat { get; set; }
public string SecondFieldWidth { get; set; }
public string ServiceCharge { get; set; }
}
我試圖用這個代碼,但它只是顯示在1只最後輸出
[WebMethod(Description = "Retrieves list of available BILLERS for collection as well as other information necessary for the transaction")]
public Biller GetBillerList(string AccountID, string UserName, string Password)
{
ECPNBills.ECPNBillsPaymentService Client = new ECPNBills.ECPNBillsPaymentService();
ECPNBills.BStruct Str = new ECPNBills.BStruct();
Biller Bil = new Biller();
Str = Client.GetBillerList(AccountID, UserName, Password);
foreach (ECPNBills.BStruct cd in Client.GetBillerList(AccountID, UserName, Password))
{
Bil.BillerTag = cd.BillerTag;
Bil.Description = cd.Description;
Bil.FirstField = cd.FirstField;
Bil.FirstFieldFormat = cd.FirstFieldFormat;
Bil.FirstFieldWidth = cd.FirstFieldWidth;
Bil.SecondField = cd.SecondField;
Bil.SecondFieldFormat = cd.SecondFieldFormat;
Bil.SecondFieldWidth = cd.SecondFieldWidth;
Bil.ServiceCharge = cd.ServiceCharge;
}
return Bil;
}
我不確定要使用哪些代碼才能從BStruct獲得所有物品。
我也試圖使用web服務web服務。預先感謝您〜
它的工作!謝謝 –