使用进度条上传附件

时间:2014-02-02 10:32:37

标签: vb.net progress-bar

我有一个xml文件作为附件。我在互联网上搜索所有这些都是通过ftp上传我无法弄清楚如何使用它们发送邮件所以如何在上传到邮件时使用进度条显示?

这是我发送电子邮件的代码

        Dim smtpServer As New SmtpClient
        Dim mail As New MailMessage()
        Dim mailAttachment As Attachment = New Attachment("XMLFile")
        smtpServer.UseDefaultCredentials = False
        smtpServer.Credentials = New Net.NetworkCredential("a@ymail.com", "12345")
        smtpServer.Port = 465
        smtpServer.EnableSsl = True
        smtpServer.Host = "smtp.mail.yahoo.com"

        mail = New MailMessage()
        mail.From = New MailAddress("a@ymail.com")
        mail.To.Add("a@ymail.com")
        mail.Subject = "110BackUp"
        mail.IsBodyHtml = False
        mail.Body = "XML FILE"
        mail.Attachments.Add(mailAttachment)
        smtpServer.Send(mail)

1 个答案:

答案 0 :(得分:0)

如果问题只是在发送电子邮件时有进度条,那么您可以找到有用的SO post