Run progress bar along with Disk Defragmentation in WPF -
i developing exe hard disk defragmentation. using startdefragmentation(string devicename)
method of idefragmenter
interface defragmentation of hard disk particular drive.
it works properly, have run progress bar display status of defragmentation, don't know how time takes complete defragmentation of particular drive. if know actual time take next thread set progress bar value , maximum property.
my code :
private void startdefragmentation() { try { private idefragmenter defragmenter; defragmenter.startdefragmentation("d:\\"); //please call background thread setting progressbar value counter , maximum property time taken startdefragmentation method } catch { } }
i use code, didn't me:
stopwatch sw = stopwatch.startnew(); defragmenter.startdefragmentation(f); sw.stop(); double timetaken = sw.elapsed.totalmilliseconds;
Comments
Post a Comment