在c#我有时间格式hhmmss喜欢124510 12:45:10我需要知道TotalSeconds.我使用了TimeSpan.Parse("12:45:10").ToTalSeconds但它不采用格式hhmmss.转换它的任何好方法?
我有一个需要很长时间的过程,我想要一个窗口来显示进度.但是,我无法想象如何显示进度.
这是代码:
if (procced)
{
// the wpf windows :
myLectureFichierEnCour = new LectureFichierEnCour(_myTandemLTEclass);
myLectureFichierEnCour.Show();
bgw = new BackgroundWorker();
bgw.DoWork += startThreadProcessDataFromFileAndPutInDataSet;
bgw.RunWorkerCompleted += threadProcessDataFromFileAndPutInDataSetCompleted;
bgw.RunWorkerAsync();
}
Run Code Online (Sandbox Code Playgroud)
和:
private void startThreadProcessDataFromFileAndPutInDataSet(object sender, DoWorkEventArgs e)
{
_myTandemLTEclass.processDataFromFileAndPutInDataSet(
_strCompositeKey,_strHourToSecondConversion,_strDateField);
}
Run Code Online (Sandbox Code Playgroud)
我可以打电话_myTandemLTEclass.processProgress来获得进展的暗示.