当前位置: 首页>>代码示例>>C#>>正文


C# Net.UploadStringCompletedEventArgs类代码示例

本文整理汇总了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());
     }
 }
开发者ID:DuBin1988,项目名称:newsellinggas,代码行数:7,代码来源:WebSaveHelper.cs

示例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;
 }
开发者ID:Titaye,项目名称:SLExtensions,代码行数:7,代码来源:PageWebClient.xaml.cs

示例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");
            }

        }
开发者ID:Handika-GEMkey,项目名称:SolidareNew,代码行数:31,代码来源:PageForgotPass.xaml.cs

示例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.");
            }
        }
开发者ID:jonatasschagas,项目名称:MyCities,代码行数:34,代码来源:SignInPage.xaml.cs

示例5: OnLoggedIn

 public void OnLoggedIn(object sender, UploadStringCompletedEventArgs e)
 {
     lock (this)
     {
         CheckLoggedIn();
     }
 }
开发者ID:tcd-tophat,项目名称:Assassin-WP7,代码行数:7,代码来源:MainPage.xaml.cs

示例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;
 }
开发者ID:DuBin1988,项目名称:newsellinggas,代码行数:7,代码来源:卡表预存.xaml.cs

示例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;
     }
 }
开发者ID:DuBin1988,项目名称:anjian_pad_server,代码行数:28,代码来源:其他严重隐患类型明细表.xaml.cs

示例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();
     }
 }
开发者ID:aymericdo,项目名称:PlanBU_WindowsPhone,代码行数:33,代码来源:Search.xaml.cs

示例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);
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:7,代码来源:Register.xaml.cs

示例10: wc_UploadStringCompleted

 private void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
 {
     if (!CheckFault(e))
     {
         this.ParseResult(e.Result, e.UserState);
     }
 }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:7,代码来源:WFSServiceBase.cs

示例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;
            }
        }
开发者ID:offspin,项目名称:building_blocks,代码行数:32,代码来源:PartySearchForm.xaml.cs

示例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.");
            } 

        } 
开发者ID:EdytaSzkiladz,项目名称:MyLocalPharmacy,代码行数:38,代码来源:SettingsChangePINModel.cs

示例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);
            }
        }
开发者ID:hsynlms,项目名称:Creatalk,代码行数:33,代码来源:Register.xaml.cs

示例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.");
               
            }
            
        }
开发者ID:EdytaSzkiladz,项目名称:MyLocalPharmacy,代码行数:37,代码来源:VerifyBySmsModel.cs

示例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());
            }
        }
开发者ID:mt2309,项目名称:Trading-Game,代码行数:34,代码来源:Register.xaml.cs


注:本文中的System.Net.UploadStringCompletedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。