1
當應用程序啓動時,它將運行DispatcherTimer。每10秒鐘,它將運行running()函數,函數running()消耗一個webservice並運行得非常好。當系統無法獲得Web服務時,它會彈出「System.timeOut異常」。如何解決異常?類型爲「System.timeOut異常」的未處理異常
感謝您的幫助您可以提供!
private void running()
{
ServiceReference1.WebServiceSoapClient test = new ServiceReference1.WebServiceSoapClient();
test.ReadTotalOutstandingInvoiceCompleted += new EventHandler<ServiceReference1.ReadTotalOutstandingInvoiceCompletedEventArgs>(serviceClient);
test.ReadTotalOutstandingInvoiceAsync();
}
private void serviceClient(object sender, ReadTotalOutstandingInvoiceCompletedEventArgs e)
{
tbTesting.Text = e.Result.ToString();
tbTextbox2.Text = "You have " + tbTesting.Text + " Invoice !!";
...
MessageBox.Show("You have " + tbTesting.Text + " new Invoice" +Environment.NewLine+ Environment.NewLine+ DateTime.Now, "Invoice", MessageBoxButton.OK);
...
}
在reference.cs
public string EndReadTotalOutstandingInvoice(System.IAsyncResult result) {
object[] _args = new object[0];
string _result = ((string)(base.EndInvoke("ReadTotalOutstandingInvoice", _args, result)));
return _result;
}
如果有消息框?當用戶點擊ok按鈕時,系統將嘗試訪問web服務。如何應用此? – likewer 2013-02-23 04:17:36
@像什麼? – user2038443 2013-02-23 04:19:30
虐待幫助你的問題,但我不寫你的代碼給你。 – user2038443 2013-02-23 04:29:34