Click here to Skip to main content
15,892,059 members
Home / Discussions / C#
   

C#

 
GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 3:36
Muammar©12-Aug-09 3:36 
GeneralRe: TreeView Recursion Pin
N a v a n e e t h12-Aug-09 7:17
N a v a n e e t h12-Aug-09 7:17 
GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 7:37
Muammar©12-Aug-09 7:37 
GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 10:41
Muammar©12-Aug-09 10:41 
AnswerSolved! Pin
Muammar©13-Aug-09 7:10
Muammar©13-Aug-09 7:10 
GeneralRe: Solved! Pin
N a v a n e e t h13-Aug-09 15:37
N a v a n e e t h13-Aug-09 15:37 
GeneralRe: Solved! Pin
Muammar©14-Aug-09 1:16
Muammar©14-Aug-09 1:16 
QuestionTrying to show progress using DownloadDataAsync Pin
steve_rm1-Aug-09 4:23
steve_rm1-Aug-09 4:23 
Hello,

VS 2008 SP1

I am using the DownloadDataAysnc. But the ProgressChanged event doesn't show progress until after the data has been downloaded.

Even when I try and download a data which is contained in a big file. The programs remains responsive so I know it is doing something. However, it is when the progress has completed that the progressChanged event fires.

I known this as the progressChanged and the DownloadDataCompleted fire immediately after each other. However, they should be a pause as the file is quite big.

This is the code snippet I am currently using. And the output below. What is strange the e.progresspercentage is 100%. And seems to get called twice.

Many thanks for any advise,

Results:
Progress changed Version userstate: [ Version1 ]
progressBar1.Value [ 100 ]
Progress changed Version userstate: [ Version1 ]
progressBar1.Value [ 100 ]
Completed data: [ 1.0.11 ]


private void UpdateAvailable()
        {
            WebClient wbCheckUpdates = new WebClient();
            wbCheckUpdates.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wbCheckUpdates_DownloadProgressChanged);
            wbCheckUpdates.DownloadDataCompleted += new DownloadDataCompletedEventHandler(wbCheckUpdates_DownloadDataCompleted);
            DownloadFiles df = new DownloadFiles();
            string webServerURL = df.webServerPath;

            wbCheckUpdates.DownloadDataAsync(new Uri(Path.Combine(webServerURL, "version.txt")), "Version1"); 
        }

void wbCheckUpdates_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            Console.WriteLine("Progress version changed userstate: [ " + e.UserState + " ]");
            progressBar1.Value = e.ProgressPercentage;
            Console.WriteLine("progressBar1.Value [ " + this.progressBar1.Value + " ]");
        }

void wbCheckUpdates_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
        {
            byte[] result = e.Result;           
            Console.WriteLine("Completed data: [ " + System.Text.ASCIIEncoding.Default.GetString(result) + " ]");
        }

AnswerRe: Trying to show progress using DownloadDataAsync Pin
Abhijit Jana1-Aug-09 6:18
professionalAbhijit Jana1-Aug-09 6:18 
QuestionRe: Trying to show progress using DownloadDataAsync Pin
Steve1_rm1-Aug-09 6:44
Steve1_rm1-Aug-09 6:44 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Eddy Vluggen1-Aug-09 7:00
professionalEddy Vluggen1-Aug-09 7:00 
GeneralRe: Trying to show progress using DownloadDataAsync Pin
Steve1_rm1-Aug-09 7:33
Steve1_rm1-Aug-09 7:33 
GeneralRe: Trying to show progress using DownloadDataAsync Pin
Eddy Vluggen1-Aug-09 8:39
professionalEddy Vluggen1-Aug-09 8:39 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Luc Pattyn1-Aug-09 8:43
sitebuilderLuc Pattyn1-Aug-09 8:43 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Alan N1-Aug-09 13:57
Alan N1-Aug-09 13:57 
QuestionConnecting C# application to online MS Access database Pin
Alexander Szmidt1-Aug-09 3:43
Alexander Szmidt1-Aug-09 3:43 
AnswerRe: Connecting C# application to online MS Access database Pin
Dave Kreskowiak1-Aug-09 5:10
mveDave Kreskowiak1-Aug-09 5:10 
AnswerRe: Connecting C# application to online MS Access database Pin
nelsonpaixao1-Aug-09 5:12
nelsonpaixao1-Aug-09 5:12 
AnswerRe: Connecting C# application to online MS Access database Pin
Eddy Vluggen1-Aug-09 7:06
professionalEddy Vluggen1-Aug-09 7:06 
QuestionCan I write programs in C # to Micro Controllers Pin
Nasir131-Aug-09 2:33
Nasir131-Aug-09 2:33 
AnswerRe: Can I write programs in C # to Micro Controllers Pin
DaveyM691-Aug-09 2:47
professionalDaveyM691-Aug-09 2:47 
RantRe: Can I write programs in C # to Micro Controllers Pin
Nasir131-Aug-09 3:58
Nasir131-Aug-09 3:58 
GeneralRe: Can I write programs in C # to Micro Controllers Pin
Dave Kreskowiak1-Aug-09 5:07
mveDave Kreskowiak1-Aug-09 5:07 
GeneralRe: Can I write programs in C # to Micro Controllers Pin
DaveyM691-Aug-09 7:03
professionalDaveyM691-Aug-09 7:03 
AnswerRe: Can I write programs in C # to Micro Controllers Pin
HimanshuJoshi1-Aug-09 3:54
HimanshuJoshi1-Aug-09 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.