Click here to Skip to main content
15,905,071 members
Home / Discussions / C#
   

C#

 
AnswerRe: Please i want help in crystal report with c# Pin
Justin Perez21-Jul-07 10:59
Justin Perez21-Jul-07 10:59 
AnswerRe: Please i want help in crystal report with c# Pin
MYOSRI21-Jul-07 11:15
MYOSRI21-Jul-07 11:15 
QuestionDataTable with rows and trying to move next and previous Pin
Marcel Vreuls (www.agentbase.nl)21-Jul-07 9:38
Marcel Vreuls (www.agentbase.nl)21-Jul-07 9:38 
AnswerRe: DataTable with rows and trying to move next and previous Pin
Amjath Rahman22-Jul-07 15:53
Amjath Rahman22-Jul-07 15:53 
GeneralRe: DataTable with rows and trying to move next and previous Pin
Marcel Vreuls (www.agentbase.nl)23-Jul-07 10:59
Marcel Vreuls (www.agentbase.nl)23-Jul-07 10:59 
Questionc# - derived classes Pin
jon-8021-Jul-07 7:36
professionaljon-8021-Jul-07 7:36 
AnswerRe: c# - derived classes Pin
Luc Pattyn21-Jul-07 7:47
sitebuilderLuc Pattyn21-Jul-07 7:47 
GeneralRe: c# - derived classes Pin
jon-8021-Jul-07 8:14
professionaljon-8021-Jul-07 8:14 
AnswerRe: c# - derived classes Pin
mav.northwind21-Jul-07 7:47
mav.northwind21-Jul-07 7:47 
AnswerRe: c# - derived classes Pin
pbraun21-Jul-07 18:56
pbraun21-Jul-07 18:56 
GeneralRe: c# - derived classes Pin
jon-8021-Jul-07 7:48
professionaljon-8021-Jul-07 7:48 
GeneralRe: c# - derived classes Pin
mav.northwind21-Jul-07 10:32
mav.northwind21-Jul-07 10:32 
QuestionProblem with the browser control Pin
Raymond_P*21-Jul-07 6:52
Raymond_P*21-Jul-07 6:52 
QuestionLocalization Pin
Goje Melegnaw21-Jul-07 6:06
Goje Melegnaw21-Jul-07 6:06 
AnswerRe: Localization Pin
Paul Conrad21-Jul-07 6:26
professionalPaul Conrad21-Jul-07 6:26 
AnswerRe: Localization Pin
DavidNohejl21-Jul-07 9:53
DavidNohejl21-Jul-07 9:53 
QuestionThread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 5:59
Johan Martensson21-Jul-07 5:59 
AnswerRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 6:22
sitebuilderLuc Pattyn21-Jul-07 6:22 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 6:54
Johan Martensson21-Jul-07 6:54 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 7:13
sitebuilderLuc Pattyn21-Jul-07 7:13 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 7:28
sitebuilderLuc Pattyn21-Jul-07 7:28 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 7:49
Johan Martensson21-Jul-07 7:49 
I will look into your suggestions, they look very interesting.
The download-methods in the download class looks like this:

<br />
        public void DownloadFile(string outPath)<br />
        {<br />
            outFile = outPath;<br />
            // Create a new thread that calls the StartDownload() method<br />
            thrDownload = new Thread(StartDownload);<br />
            // Start the thread, and thus call StartDownload()<br />
            thrDownload.Start();<br />
        }<br />
<br />
private void StartDownload()<br />
        {<br />
            try<br />
            {<br />
                // Create a request to the file we are downloading<br />
                webRequest = (HttpWebRequest)WebRequest.Create(dowloadUrl);<br />
                // Set the proxy to use if any<br />
                if (!dowloadProxy.Equals(string.Empty))<br />
                    webRequest.Proxy = new WebProxy(dowloadProxy);<br />
                // Set the startingpoint of the stream if any and resume is aloud<br />
                //if (startPoint > 0 && resumeIsAloud)<br />
                //    webRequest.AddRange(startPoint);<br />
<br />
                if(endOffset>0)<br />
                 webRequest.AddRange(startOffset, endOffset);<br />
                else<br />
                 webRequest.AddRange(startOffset);<br />
<br />
                // Set default authentication for retrieving the file<br />
                webRequest.Credentials = CredentialCache.DefaultCredentials;<br />
                // Retrieve the response from the server<br />
                webResponse = (HttpWebResponse)webRequest.GetResponse();<br />
                //Ask the server for the file size and store it<br />
                fileSize = webResponse.ContentLength;<br />
                // Get the response-stream<br />
                strResponse = webResponse.GetResponseStream();<br />
<br />
                // Set the output-stream<br />
                strLocal = new FileStream(outFile, FileMode.Create, FileAccess.Write, FileShare.None);<br />
<br />
                // It will store the current number of bytes we retrieved from the server<br />
                int bytesSize;<br />
                // A buffer for storing and writing the data retrieved from the server<br />
                byte[] downBuffer = new byte[2048];<br />
<br />
                // Set the start-time<br />
                downStart = DateTime.Now;<br />
<br />
                // Loop through the buffer until the buffer is empty<br />
                while ((bytesSize = strResponse.Read(downBuffer, 0, downBuffer.Length)) > 0)<br />
                {<br />
                    // Write the data from the buffer to the local hard drive<br />
                    strLocal.Write(downBuffer, 0, bytesSize);<br />
                    CalculateDownloadingInfo();<br />
                }<br />
            }<br />
            catch (Exception e)<br />
            {<br />
                lastError = e;<br />
                RaiseDownloadError(e);<br />
            }<br />
            finally<br />
            {<br />
                if (strResponse != null) strResponse.Close();<br />
                if (strLocal != null) strLocal.Close();<br />
                if (thrDownload != null) thrDownload.Abort();<br />
            }<br />
        }<br />

GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 8:18
sitebuilderLuc Pattyn21-Jul-07 8:18 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 9:18
Johan Martensson21-Jul-07 9:18 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 9:54
sitebuilderLuc Pattyn21-Jul-07 9: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.