<bdo id='n5eAr'></bdo><ul id='n5eAr'></ul>
    <tfoot id='n5eAr'></tfoot>
  • <legend id='n5eAr'><style id='n5eAr'><dir id='n5eAr'><q id='n5eAr'></q></dir></style></legend>
  • <i id='n5eAr'><tr id='n5eAr'><dt id='n5eAr'><q id='n5eAr'><span id='n5eAr'><b id='n5eAr'><form id='n5eAr'><ins id='n5eAr'></ins><ul id='n5eAr'></ul><sub id='n5eAr'></sub></form><legend id='n5eAr'></legend><bdo id='n5eAr'><pre id='n5eAr'><center id='n5eAr'></center></pre></bdo></b><th id='n5eAr'></th></span></q></dt></tr></i><div id='n5eAr'><tfoot id='n5eAr'></tfoot><dl id='n5eAr'><fieldset id='n5eAr'></fieldset></dl></div>

        <small id='n5eAr'></small><noframes id='n5eAr'>

      1. 使用 smtpClient.send 显示进度条

        Show Progress bar with smtpClient.send(使用 smtpClient.send 显示进度条)

          • <i id='MvPVZ'><tr id='MvPVZ'><dt id='MvPVZ'><q id='MvPVZ'><span id='MvPVZ'><b id='MvPVZ'><form id='MvPVZ'><ins id='MvPVZ'></ins><ul id='MvPVZ'></ul><sub id='MvPVZ'></sub></form><legend id='MvPVZ'></legend><bdo id='MvPVZ'><pre id='MvPVZ'><center id='MvPVZ'></center></pre></bdo></b><th id='MvPVZ'></th></span></q></dt></tr></i><div id='MvPVZ'><tfoot id='MvPVZ'></tfoot><dl id='MvPVZ'><fieldset id='MvPVZ'></fieldset></dl></div>
          • <small id='MvPVZ'></small><noframes id='MvPVZ'>

              <tbody id='MvPVZ'></tbody>
            <tfoot id='MvPVZ'></tfoot>

                <bdo id='MvPVZ'></bdo><ul id='MvPVZ'></ul>
                <legend id='MvPVZ'><style id='MvPVZ'><dir id='MvPVZ'><q id='MvPVZ'></q></dir></style></legend>
                  本文介绍了使用 smtpClient.send 显示进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用此功能通过 gmail 发送邮件.

                  I am using this function to send mails via gmail.

                  private bool uploadToGmail(string username, string password , string file , 
                      string backupnumber)
                  {
                      MailMessage mail = new MailMessage();
                      SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                      mail.From = new MailAddress("jain@gmail.com");
                      mail.To.Add("jain@gmail.com");
                      mail.Subject = "Backup mail- Dated- " + DateTime.Now + " part - " + 
                          backupnumber;
                      mail.Body = "Hi self. This mail contains 
                   backup number- " + 
                          backupnumber + " 
                   Dated- " + DateTime.Now ;
                  
                      System.Net.Mail.Attachment attachment;
                      attachment = new System.Net.Mail.Attachment(file);
                      mail.Attachments.Add(attachment);
                  
                      SmtpServer.Port = 587;
                      SmtpServer.Credentials = 
                          new System.Net.NetworkCredential("jain@gmail.com", "password");
                      SmtpServer.EnableSsl = true;
                  
                      SmtpServer.Timeout = 999999999;
                      SmtpServer.Send(mail);
                      //  MessageBox.Show("mail Sent");
                      return true;
                  }
                  

                  现在我想显示一个进度条(以防附件很大)来显示上传.这可能吗 ?我想我知道如何使用进度条,但不知道如何将它与 Smtpclient.send() 一起使用.

                  Now I want to show a progress bar (in case there is a large attachment) to show the upload . Is this possible ? I think I know how to use a progress bar, but don't know how to use it with Smtpclient.send() .

                  有什么帮助吗?

                  谢谢

                  推荐答案

                  你应该使用 SendAsync 并订阅 SendCompleted,知道何时发送您的邮件完成.但是,无法获取发送过程的进度...

                  You should use SendAsync and subscribe to SendCompleted, to know, when the sending your mail completed. There is no way to get the progress of the send process, though...

                  这篇关于使用 smtpClient.send 显示进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Populate ListBox with a IEnumrable on another thread (winforms)(在另一个线程(winforms)上使用 IEnumrable 填充 ListBox)
                  listbox selected item give me quot; System.Data.DataRowViewquot; , C# winforms(列表框选择的项目给我quot;System.Data.DataRowView, C# Winforms)
                  Cannot remove items from ListBox(无法从列表框中删除项目)
                  Preventing ListBox scrolling to top when updated(更新时防止列表框滚动到顶部)
                  Drag and drop from list to canvas on windows phone with MVVM(使用 MVVM 在 Windows 手机上从列表拖放到画布)
                  Deselection on a WPF listbox with extended selection mode(具有扩展选择模式的 WPF 列表框上的取消选择)

                  <i id='rJumY'><tr id='rJumY'><dt id='rJumY'><q id='rJumY'><span id='rJumY'><b id='rJumY'><form id='rJumY'><ins id='rJumY'></ins><ul id='rJumY'></ul><sub id='rJumY'></sub></form><legend id='rJumY'></legend><bdo id='rJumY'><pre id='rJumY'><center id='rJumY'></center></pre></bdo></b><th id='rJumY'></th></span></q></dt></tr></i><div id='rJumY'><tfoot id='rJumY'></tfoot><dl id='rJumY'><fieldset id='rJumY'></fieldset></dl></div>
                        <bdo id='rJumY'></bdo><ul id='rJumY'></ul>

                        <legend id='rJumY'><style id='rJumY'><dir id='rJumY'><q id='rJumY'></q></dir></style></legend>
                          <tbody id='rJumY'></tbody>
                        <tfoot id='rJumY'></tfoot>
                        1. <small id='rJumY'></small><noframes id='rJumY'>