开发者

How to show progress bar while attaching files in C#

开发者 https://www.devze.com 2023-01-29 22:25 出处:网络
I am attaching file for mail through C#. I am using below code: Attachment data = new Attachment(fileName);

I am attaching file for mail through C#. I am using below code:

  Attachment data = new Attachment(fileName);
  mailMsg.Attachments.Add(data);

I want to show a progress bar whil开发者_运维问答e attaching file. How can I do this?


Unless the mailMsg object has some kind of progress event, you probably can't get the progress for a single attatchment.

However, if you are attatching multiple files, you can report the ratio of files completed to total files as a percentage instead. To do that, add a ProgressBar to your window, then update the value of it after each file is done.

0

精彩评论

暂无评论...
验证码 换一张
取 消