停止CSV文件写入 [英] Stop CSV file writing
本文介绍了停止CSV文件写入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,专家,
在我的C#Windows应用程序中.
例如,我有两个按钮(导出"和取消").
如果我点击导出按钮,它将执行诸如将大量数据导出/写入.CSV文件之类的操作.
工作正常.
在写入.CSV文件时,当我按下取消"按钮时,需要停止写入文件并删除该文件.
请与我分享您的想法.
Hi Experts,
In my C# windows application.
for example i have two buttons(Export and Cancel).
If i hit export button it will perfrom the operation like exporting/writing some large data to .CSV file.
Its working fine.
While writing to the .CSV file, when i hit the cancel button writing file need to be stop and delete the file.
Please share with me your ideas.
推荐答案
您好,
您可以创建可以在后台工作的BackgroundWorker,还可以处理事件以执行所需的工作.
检查 MSDN文章:后台工作者 [
Hi,
You can Create BackgroundWorker which can be used to work in background and you can handle events to perform your desired work.
Check MSDN Article : Background Worker[^]
Hope it will work for you.
Thanks.
这篇关于停止CSV文件写入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文