How to use Threadpool.QueueUserWorkItem in a windows service?
问题 I have a windows service where I am using Threadpool.QueueUserWorkItem. The service connects to multiple client databases, grabs data, converts to XLS and send files to the corresponding FTP. I have 3 questions regarding the code below: Am I using the Threadpool.QueueUserWorkItem correctly? Do I need to use Lock anywhere in the code to avoid issues? If yes, where and to what object. Is there anything that is not correct in the code? If yes, what and how to deal with it? Code: private static