How to force FileSystemWatcher to wait till the file downloaded?

前端 未结 4 964
面向向阳花
面向向阳花 2021-02-08 20:11

I am downloading a file and want to execute the install only after the download is complete. How do I accomplish this? Seems like FileSystemWatcher onCreate event would do this

4条回答
  •  伪装坚强ぢ
    2021-02-08 20:30

    If you are using WebClient to download, you can use set the client's DownloadFileCompleted eventhandler.
    If you do it this way you can also use client.DownloadFileAsync() to make it download asynchronously.

提交回复
热议问题