|
Greeeg wrote: so I do a "\r\n"
Yeah, I thought of that later...
Greeeg wrote: Won't this create a terribly large string in memory when I send mails with attachments of several megabytes in size?
I'm sure it will flush by itself from time to time, but if you're writing to disc, surely forcing the write of every couple of bytes is going to be your biggest time issue ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I moved the flush call behind the loop and together with the StringBuilder the client receives the mail now with >1Mb/sec now instead of the poor 100-300Kb/sek previously.
thanks!
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Cool - glad to help
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't want to take away from anything that you have already achieved but StringBuilder is probably not a good idea here. Plain concatenation is almost certain to be faster for a small number of operations (up to about half a dozen). StringBuilder only wins when you're doing lots of concatenations to the same string or if the original string is very long (don't ask me to define 'very long'; you would need to experiment).
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
I do lots of concatenations to the same string over and over, namely whenever new mail data arrives, which happens quite a few times in a second.
With simple concatenation it took my client almost 5 Minutes to receive about 2mb of mail data, with StringBuilder it's 5 seconds now!
I only use StringBuilder when I need to concatenate a string over and over again multiple times.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
OK. My comment was based on the code you show, which only does a single two-character concatenation.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
|
tota_1 wrote: Thank alot but i need it urgently
First of all, if this isn't homework, I can't imagine what you'd need this for. Therefore, you need to do your own homework.
Secondly, saying 'I need it urgently' is plain rude - people on this forum will help you of their own free will, they are not beholden to you in any way, nor can you demand a time frame. Try to do your own homework, ask some specific questions when you're stuck, and we'll try to help, when we can.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, please do not waste people's time with your homework
-- modified at 9:45 Monday 23rd January, 2006
This wasn't meant for Christian but for tota_1...
|
|
|
|
|
You might want to reply to the original poster, not Christian. I don't think he needs to be told how not to post his "homework" questions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Oops, my bad, I meant the original poster. Thanks for the correction.
Yes, Christian probably DOES NOT need any help with "homework."
Paul
|
|
|
|
|
Hello ,
I want a good and easy tutorial of how to compile and build the final package.
It should contain:
1. EXE file
2. Needed Dll's.
3. Few Wavs (sound) files.
4. FrameWork deploiment if the user will need)
and if posible i want it to have only 1 EXE file that the user must run and it will install it all.
p.s: what about the start menu and desktop link? just like the old VB did..
Realy thanks alot,
Ran.
R.Z
|
|
|
|
|
have you tried googling "Setup and Deployment Projects" aspect of visual studio. Also there is an article on codeproject on how to setup and deploy projects using visual studio (i think!!!).
Enjoy!
edit:
try this http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp
|
|
|
|
|
Hi all,
I want to be able to call from my program and run Internet Explorer with a specific link.
what is the easiest way that takes less effort and resources?
Thanks,
Ran
R.Z
|
|
|
|
|
string strLink = "http://ravib.com";
System.Diagnostics.Process.Start ("IExplore.exe", strLink); /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thanks.
i will try it.
R.Z
|
|
|
|
|
Hello ,
I need to move the focus on the next control when the user press on the Enter key.like he press the tab key.
Please help.
hoho,
|
|
|
|
|
what is the "next control" is it another tab page or a text button or text box or what.... give me some info to go off of....
|
|
|
|
|
thanks for your reply...
It is some of textboxs control i need the user to move from frist textbox to the next when he press enter.
Best Regards,
Hoho
|
|
|
|
|
|
How do I find out if the threads in the threadPool has finished their operation??
|
|
|
|
|
cannot find out if the threads in the default System.Threading.ThreadPool have ended.
To do this, you can roll your own like Ami Bar[^] does in this article[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
How can i make the tabpage button of a tabcontrol start from the right edge of the control with C# ?
M.Gamal
|
|
|
|
|
Hi friends
In my c# project I have a Main form with a panel1 on it and a user control named Thumbs in the solution ,
The panel1 hosting instances of thumbs as its child controls .the problem is that when mouse clicks on the
child controls of panel1 the Panel1_click event not fires but this works when the mouse locates between
the thumbs (gap erea) , so the question would be How is possible to fire a parent control event(here panel1)
from its child controls(here thumbs) events?
Please If some of you knows ho to get trough let me know with some code if possible.
thanks.
M.Jaf
|
|
|
|