本文整理汇总了C#中System.Net.UploadStringCompletedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# UploadStringCompletedEventArgs类的具体用法?C# UploadStringCompletedEventArgs怎么用?C# UploadStringCompletedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UploadStringCompletedEventArgs类属于System.Net命名空间,在下文中一共展示了UploadStringCompletedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: client_UploadStringCompleted
static void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
if (e.Error != null)
{
log.Debug("保存数据失败!" + e.Error.ToString());
}
}
示例2: webclient_FileUploadStringCompleted
void webclient_FileUploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
WebClient webclient = (WebClient)sender;
webclient.UploadStringCompleted -= new UploadStringCompletedEventHandler(webclient_FileUploadStringCompleted);
webclient.UploadProgressChanged -= new UploadProgressChangedEventHandler(webclient_UploadProgressChanged);
result2.Text = e.Result;
}
示例3: uploadResetComplete
private void uploadResetComplete(object sender, UploadStringCompletedEventArgs e)
{
try
{
JObject jresult = JObject.Parse(e.Result);
string Result = jresult["result"].ToString();
if (Result.Equals("sukses"))
{
MessageBox.Show("Please check your email!");
NavigationService.Navigate(new Uri("/Views/PageStart4.xaml", UriKind.Relative));
}
else
{
MessageBox.Show("Your email is not registered");
}
}
catch (TimeoutException)
{
MessageBox.Show("Login failed. Please check your internet connection");
}
catch (NullReferenceException)
{
MessageBox.Show("Login failed. Please check your username or password");
}
catch (WebException)
{
MessageBox.Show("Login failed. Please check your internet connection");
}
}
示例4: signinComplete
private void signinComplete(object sender, UploadStringCompletedEventArgs e)
{
progressBarLogin.Visibility = Visibility.Collapsed;
try
{
if ((e.Result != null) && (e.Error == null))
{
string jsonString = e.Result.ToString();
using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(jsonString)))
{
var response = new DataContractJsonSerializer(typeof(User));
User user = (User)response.ReadObject(ms);
if (user.LoginState == "ok")
{
// saving state and moving to the next page
ApplicationStateHelper.SaveUserToIsolatedStorage(user);
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
}
else
{
MessageBox.Show("Unable to Sign In. Try again...");
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("Unable to Sign In.");
}
}
示例5: OnLoggedIn
public void OnLoggedIn(object sender, UploadStringCompletedEventArgs e)
{
lock (this)
{
CheckLoggedIn();
}
}
示例6: wc_UploadStringCompleted
void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
(sender as WebClient).UploadStringCompleted -= wc_UploadStringCompleted;
print.State = State.Start;
print.TipPrint();
VerificationPopUp.Visibility = Visibility.Collapsed;
}
示例7: wc_UploadStringCompleted
void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
if (e.Error == null)
{
JsonArray items = JsonValue.Parse(e.Result) as JsonArray;
ObjectList list = new ObjectList();
list.EntityType = "T_INSPECTION_LINE";
foreach(JsonObject row in items)
{
GeneralObject go = new GeneralObject();
go.EntityType = "T_INSPECTION_LINE";
go.SetPropertyValue("precaution", row["precaution"], true);
go.SetPropertyValue("road", row["road"], true);
go.SetPropertyValue("unit_name", row["unit_name"], true);
go.SetPropertyValue("cus_dom", row["cus_dom"], true);
go.SetPropertyValue("cus_dy", row["cus_dy"], true);
go.SetPropertyValue("cus_floor", row["cus_floor"], true);
go.SetPropertyValue("cus_room", row["cus_room"], true);
go.SetPropertyValue("user_name", row["user_name"], true);
go.SetPropertyValue("telphone", row["telphone"], true);
go.SetPropertyValue("departure_time", row["departure_time"], true);
go.SetPropertyValue("precaution_notified", row["precaution_notified"], true);
go.SetPropertyValue("sn", row["sn"], true);
list.Add(go);
}
paperGrid.ItemsSource = list;
}
}
示例8: download_allToSearch
private void download_allToSearch(object sender, UploadStringCompletedEventArgs e)
{
try
{
JObject obj = JObject.Parse(e.Result);
//System.Diagnostics.Debug.WriteLine(obj);
JArray jarr = (JArray)obj["discipline"];
foreach (var item in jarr)
{
_list_Res.Add(new Resultat(int.Parse(item["id"].ToString()), item["libelle"].ToString(), "Discipline"));
}
JArray jarr2 = (JArray)obj["thematique"];
foreach (var item2 in jarr2)
{
_list_Res.Add(new Resultat(int.Parse(item2["id"].ToString()), item2["libelle"].ToString(), "Thématique"));
}
JArray jarr3 = (JArray)obj["sousthematique"];
foreach (var item3 in jarr3)
{
_list_Res.Add(new Resultat(int.Parse(item3["id"].ToString()), item3["libelle"].ToString(), "Sous-Thématique"));
}
progressBar.Visibility = Visibility.Collapsed;
fillListBox(String.Empty);
}
catch (Newtonsoft.Json.JsonReaderException)
{
asyncTask();
}
catch (System.Reflection.TargetInvocationException)
{
asyncTask();
}
}
示例9: registrationComplete
private void registrationComplete(object sender, UploadStringCompletedEventArgs e)
{
LoadingProgressIndicator.Show(false);
var registerSuccess = (e.Error == null);
MessageBox.Show(registerSuccess ? AppResources.RegisterSuccess : AppResources.RegisterFailure, "",
MessageBoxButton.OK);
}
示例10: wc_UploadStringCompleted
private void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
if (!CheckFault(e))
{
this.ParseResult(e.Result, e.UserState);
}
}
示例11: DeleteCompleted
private void DeleteCompleted(object sender, UploadStringCompletedEventArgs e)
{
try
{
CheckForErrors(e);
string returnTypeName = app.GetBusinessObjectType(e.Result);
switch (returnTypeName)
{
case "Acknowledgement":
PartyService.Acknowledgement ack = app.LoadBusinessObject<PartyService.Acknowledgement>(e.Result);
MessagePopUp ackPopUp = new MessagePopUp(ack.Message, MessagePopUp.MessagePopUpType.OK);
ackPopUp.Show();
break;
case "Error":
PartyService.Error err = app.LoadBusinessObject<PartyService.Error>(e.Result);
throw (new Exception(err.Message));
default:
throw (new Exception("Unrecognised object type in server response"));
}
}
catch (Exception ex)
{
app.ShowError(ex.Message);
}
finally
{
formBusyIndicator.IsBusy = false;
}
}
示例12: ChangePinWebServiceCall_UploadStringCompleted
/// <summary>
/// Response of web service
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ChangePinWebServiceCall_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
ChangePinResponse objChangePinResponse = new ChangePinResponse();
try
{
if (e.Result != null)
{
var response = e.Result.ToString();
objChangePinResponse = Utils.JsonHelper.Deserialize<ChangePinResponse>(response);
if (objChangePinResponse.status == 0)
{
App.PIN = objSettingsConfirmChangePinVM.Pin;
App.HashPIN = newPinHashed;
objSettingsConfirmChangePinVM.IsSuccessPopupOpen = true;
objSettingsConfirmChangePinVM.HitVisibility = false;
objSettingsConfirmChangePinVM.SuccessPopupText = objChangePinResponse.message;
}
else
{
objSettingsConfirmChangePinVM.IsSuccessPopupOpen = true;
objSettingsConfirmChangePinVM.HitVisibility = false;
objSettingsConfirmChangePinVM.SuccessPopupText = objChangePinResponse.message;
}
}
}
catch (Exception)
{
objSettingsConfirmChangePinVM.HitVisibility = true;
MessageBox.Show("Sorry, Unable to process your request.");
}
}
示例13: uCompleted
public void uCompleted(object sender, UploadStringCompletedEventArgs e)
{
//MessageBox.Show(e.Result); //debug mode
//butonu aktif ediyoruz
register.IsEnabled = true;
try
{
if (classes.Oauth.ParseXML("result", e.Result) == "1")
{
MessageBox.Show(classes.General.DecodeBase64(classes.Oauth.ParseXML("result_text", e.Result)));
//NavigationService.Navigate(new Uri("/Login.xaml", UriKind.Relative));
NavigationService.GoBack();
}
else if (classes.Oauth.ParseXML("result", e.Result) == "0" && classes.Oauth.ParseXML("result_text", e.Result) != "")
MessageBox.Show(classes.General.DecodeBase64(classes.Oauth.ParseXML("result_text", e.Result)));
}
catch (TargetInvocationException ex)
{
//BugSenseHandler.Instance.SendExceptionAsync(ex);
MessageBox.Show("Lütfen yeniden deneyin.");
//MessageBox.Show(ex.Message);
}
catch (Exception ex)
{
//BugSenseHandler.Instance.SendExceptionAsync(ex);
MessageBox.Show("Bir hata oluştu : r0x001");
//General.SendBugReport(e.Result, "r0x001", ex.Message, ex.Source, ex.HelpLink);
}
}
示例14: resetpinswebservicecall_UploadStringCompleted
/// <summary>
/// Method to get response of web service
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void resetpinswebservicecall_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
ResetPinResponse objResetPinResponse = new ResetPinResponse();
try
{
if (e.Result != null)
{
var response = e.Result.ToString();
objResetPinResponse = Utils.JsonHelper.Deserialize<ResetPinResponse>(response);
if (objResetPinResponse.status == 0)
{
objVerifyBySmsViewModel.IsResentPopupOpen = true;
objVerifyBySmsViewModel.HitVisibility = false;
}
else if (objResetPinResponse.status == 324)
{
objVerifyBySmsViewModel.IsRequestPopupOpen = true;
objVerifyBySmsViewModel.HitVisibility = false;
objVerifyBySmsViewModel.PopupText = objResetPinResponse.message;
}
}
}
catch (Exception)
{
objVerifyBySmsViewModel.HitVisibility = true;
MessageBox.Show("Sorry, Unable to process your request.");
}
}
示例15: dataCompleted
private void dataCompleted(object sender, UploadStringCompletedEventArgs e)
{
if (e.Error == null)
{
try
{
XDocument doc = XDocument.Parse(e.Result);
if (doc.Element("validity") == null && doc.Element("validity") == null)
{
this.DialogResult = true;
}
else if (doc.Element("validity") != null)
{
lbl_confirm_fail.Content = (string)doc.Element("validity");
lbl_confirm_fail.Visibility = Visibility.Visible;
txt_username.Focus();
}
else
{
MessageBox.Show("Error: " + (string)doc.Element("error"));
txt_username.Focus();
}
}
catch (Exception e1)
{
MessageBox.Show("Error: " + e1.ToString());
}
}
else
{
MessageBox.Show("ERROR " + e.Error.ToString());
}
}