Click here to Skip to main content
15,879,474 members
Home / Discussions / C#
   

C#

 
GeneralRe: speech recogntion Pin
ekynox23-Jan-06 0:48
ekynox23-Jan-06 0:48 
GeneralRe: speech recogntion Pin
Colin Angus Mackay23-Jan-06 0:57
Colin Angus Mackay23-Jan-06 0:57 
GeneralRe: speech recogntion Pin
mahmoud_sam23-Jan-06 22:31
mahmoud_sam23-Jan-06 22:31 
GeneralRe: speech recogntion Pin
mahmoud_sam23-Jan-06 22:25
mahmoud_sam23-Jan-06 22:25 
QuestionHashtable memory use Pin
theanton22-Jan-06 12:25
theanton22-Jan-06 12:25 
QuestionStreamReader/Writer speed Pin
User 665822-Jan-06 11:55
User 665822-Jan-06 11:55 
AnswerRe: StreamReader/Writer speed Pin
Christian Graus22-Jan-06 12:18
protectorChristian Graus22-Jan-06 12:18 
GeneralRe: StreamReader/Writer speed Pin
User 665822-Jan-06 12:27
User 665822-Jan-06 12:27 
Christian Graus wrote:
First of all, unstead of \r\n, use Environment.NewLine.


The SMTP and POP3 protocols require data to be ended with CRLF, but some operating systems use something different as NewLine, so I do a "\r\n"

Christian Graus wrote:
hen, a stringbuilder gets created before the loop, you add your strings in the loop ( but add the newline on a seperate line, or you're still concatenating strings as you go ). Then use the ToString method to get your string at the end.


That's what I just implemented. Looks like I had the same idea

Christian Graus wrote:
The calls to Flush are also expensive and unnecessary, flush once at the end if you need to.


Won't this create a terribly large string in memory when I send mails with attachments of several megabytes in size?

Right now the client receives my mails with about 500-800Kbytes/sec, this is a little improvement, but I think this can be done faster.
Okay, using writer.Flush() after the loop makes the whole thing pretty fast, definately >1Mbyte/sec, but what about memory consumption?

regards

-- modified at 18:29 Sunday 22nd January, 2006

modified 12-Sep-18 21:01pm.

GeneralRe: StreamReader/Writer speed Pin
Christian Graus22-Jan-06 12:30
protectorChristian Graus22-Jan-06 12:30 
GeneralRe: StreamReader/Writer speed Pin
User 665822-Jan-06 12:33
User 665822-Jan-06 12:33 
GeneralRe: StreamReader/Writer speed Pin
Christian Graus22-Jan-06 12:35
protectorChristian Graus22-Jan-06 12:35 
AnswerRe: StreamReader/Writer speed Pin
Phil J Pearson23-Jan-06 2:35
Phil J Pearson23-Jan-06 2:35 
GeneralRe: StreamReader/Writer speed Pin
User 665823-Jan-06 8:38
User 665823-Jan-06 8:38 
GeneralRe: StreamReader/Writer speed Pin
Phil J Pearson23-Jan-06 9:29
Phil J Pearson23-Jan-06 9:29 
Question[Message Deleted] Pin
tota_122-Jan-06 11:35
tota_122-Jan-06 11:35 
AnswerRe: boolean equation Pin
Christian Graus22-Jan-06 11:45
protectorChristian Graus22-Jan-06 11:45 
GeneralRe: boolean equation Pin
Paul Conrad22-Jan-06 14:58
professionalPaul Conrad22-Jan-06 14:58 
GeneralRe: boolean equation Pin
Dave Kreskowiak22-Jan-06 16:00
mveDave Kreskowiak22-Jan-06 16:00 
GeneralRe: boolean equation Pin
DavidNohejl22-Jan-06 20:57
DavidNohejl22-Jan-06 20:57 
GeneralRe: boolean equation Pin
Paul Conrad23-Jan-06 3:27
professionalPaul Conrad23-Jan-06 3:27 
QuestionFinal Package creation Pin
ranzask22-Jan-06 11:13
ranzask22-Jan-06 11:13 
AnswerRe: Final Package creation Pin
ekynox22-Jan-06 12:05
ekynox22-Jan-06 12:05 
Questionhow to launch Internet Explorer with a link Pin
ranzask22-Jan-06 11:08
ranzask22-Jan-06 11:08 
AnswerRe: how to launch Internet Explorer with a link Pin
Ravi Bhavnani22-Jan-06 11:18
professionalRavi Bhavnani22-Jan-06 11:18 
GeneralRe: how to launch Internet Explorer with a link Pin
ranzask22-Jan-06 11:26
ranzask22-Jan-06 11:26 

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.