Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hi,
Sorry For Repost.Already Posted Same issue.Am new to WPF.
We have developing Download manager.When net disconnect automatically found download manager.Then Pause it temporarily.Then After get connection It will download Will process.the above Same Procedure used in system shutdown too.
(net detect method is placed inside the timer.so it will check every second.)
Then Pause and resume is working properly when internet connection is on.
My Issue is

1)First i tried net detect method checking while downloading.Then it detected net.so during net disconnect my backround worker thread stoped.so i cannot make Resume After That.

2)Then i used another method.during progress cahnged event in UI.I am checking net detect method.when i used in this method progress changing process is not working ..because every time it checked the net. due to that i leaved that.

3)Third method ,I used file straem writer after disconnect internet.it s also not working properly.
Posted

1 solution

.NET 4.0 has the built-in parallel extension which takes care of the parallel processing challenges. You can try that.

C#
IEnumerable<Int32> items = Enumerable.Range(0,20);

Parallel.ForEach(items,
    (item) => ProcessLoop(item));



Check for Parallel.For or Parallel.Foreach in the web.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900