How to create an asynchronous method

前端 未结 7 2076
误落风尘
误落风尘 2020-12-22 20:18

I have simple method in my C# app, it picks file from FTP server and parses it and stores the data in DB. I want it to be asynchronous, so that user perform other operations

相关标签:
7条回答
  • 2020-12-22 20:48

    In the end you will have to use some sort of threading. The way it basically works is that you start a function with a new thread and it will run until the end of the function.

    If you are using Windows Forms then a nice wrapper that they have for this is call the Background Worker. It allows you to work in the background with out locking up the UI form and even provides a way to communicate with the forms and provide progress update events.

    Background Worker

    0 讨论(0)
提交回复
热议问题