Click here to Skip to main content
15,884,353 members
Home / Discussions / C#
   

C#

 
Question[Message Deleted] Pin
hkjghkj112-Jun-09 20:23
hkjghkj112-Jun-09 20:23 
AnswerRe: WindowsMediaPlayer Pin
Christian Graus12-Jun-09 20:46
protectorChristian Graus12-Jun-09 20:46 
General[Message Deleted] Pin
hkjghkj112-Jun-09 21:04
hkjghkj112-Jun-09 21:04 
GeneralRe: WindowsMediaPlayer Pin
Christian Graus12-Jun-09 22:21
protectorChristian Graus12-Jun-09 22:21 
QuestionPrinter Settings Pin
Kim061812-Jun-09 19:58
Kim061812-Jun-09 19:58 
AnswerRe: Printer Settings Pin
DavidKiryazi12-Jun-09 20:02
DavidKiryazi12-Jun-09 20:02 
AnswerRe: Printer Settings Pin
Dr.Walt Fair, PE12-Jun-09 20:12
professionalDr.Walt Fair, PE12-Jun-09 20:12 
QuestionDownload Speed Pin
gonzalodiaz12-Jun-09 18:51
gonzalodiaz12-Jun-09 18:51 
Im trying to make an app, that i can download my mails from my account.

For the test i have 4 mails, total 200kb. When i download the mails, it takes 30 secs.. aprox.. A LOT! and i dont know how to improve the velocity.


Thanks!


The code that i use to download is this:

ns = networkstream from a TCP, buffer 8192.
private string getemailtest2(int indexservidor)
        {
            StringBuilder resp1 = new StringBuilder();
            bool begin = true;
           
            int compa = 8193;
            System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
            while (true)
            {
                byte[] dataaleer = new byte[8192];
                if (ns.DataAvailable || begin)
                {
                    int a = ns.Read(dataaleer, 0, 8192);
                }
                resp1.Append(enc.GetString(dataaleer).Trim('\0'));
                if (begin)
                {
                    compa = Int32.Parse(resp1.ToString().Split(' ')[1]);
                    begin = false;
                }
                int leng = enc.GetBytes(resp1.ToString()).Length;
                if (leng >= compa)
                {
                    if (!ns.DataAvailable)
                    {
                        break;
                    }
                }

            }
            return resp1.ToString();



AnswerRe: Download Speed Pin
Luc Pattyn12-Jun-09 19:23
sitebuilderLuc Pattyn12-Jun-09 19:23 
GeneralRe: Download Speed Pin
Guffa12-Jun-09 20:08
Guffa12-Jun-09 20:08 
QuestionDatabase query Pin
rht8612-Jun-09 18:47
rht8612-Jun-09 18:47 
AnswerRe: Database query Pin
Luc Pattyn12-Jun-09 19:09
sitebuilderLuc Pattyn12-Jun-09 19:09 
QuestionMagical persistence Pin
Peter Trevor12-Jun-09 18:12
Peter Trevor12-Jun-09 18:12 
AnswerRe: Magical persistence Pin
Luc Pattyn12-Jun-09 18:21
sitebuilderLuc Pattyn12-Jun-09 18:21 
GeneralRe: Magical persistence Pin
Peter Trevor13-Jun-09 13:25
Peter Trevor13-Jun-09 13:25 
AnswerRe: Magical persistence Pin
Henry Minute13-Jun-09 2:35
Henry Minute13-Jun-09 2:35 
GeneralRe: Magical persistence Pin
Peter Trevor13-Jun-09 13:23
Peter Trevor13-Jun-09 13:23 
GeneralRe: Magical persistence Pin
Peter Trevor23-Jun-09 12:59
Peter Trevor23-Jun-09 12:59 
AnswerRe: Magical persistence Pin
Peter Trevor9-Oct-09 7:00
Peter Trevor9-Oct-09 7:00 
QuestionPrint Barcode Pin
samulong12-Jun-09 18:03
samulong12-Jun-09 18:03 
AnswerRe: Print Barcode Pin
DavidKiryazi12-Jun-09 19:57
DavidKiryazi12-Jun-09 19:57 
GeneralRe: Print Barcode Pin
OriginalGriff12-Jun-09 23:20
mveOriginalGriff12-Jun-09 23:20 
JokeRe: Print Barcode Pin
DavidKiryazi12-Jun-09 23:40
DavidKiryazi12-Jun-09 23:40 
GeneralRe: Print Barcode Pin
OriginalGriff13-Jun-09 0:00
mveOriginalGriff13-Jun-09 0:00 
AnswerRe: Print Barcode Pin
Christian Graus12-Jun-09 20:34
protectorChristian Graus12-Jun-09 20:34 

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.