BackgroundWorker WPF difficulties with Progress Bar

后端 未结 2 537
失恋的感觉
失恋的感觉 2020-12-20 07:41

I am developing a WPF, C# application and I have to read a very big CSV file and write to a database. This process takes a long time so I want to at least show a progress ba

2条回答
  •  时光说笑
    2020-12-20 08:02

    is the varible i int? if it is, the value of (100 * i) / 10000 will return 0 while i < 100. and the param of ReportProgress method should be a precent value. you can change it to worker.ReportProgress(i);,try it.

提交回复
热议问题