Click here to Skip to main content
15,919,423 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using COM Objects from C# Pin
Andrew Peace30-Mar-03 8:07
Andrew Peace30-Mar-03 8:07 
Questiondelegates=strong refs? Pin
Roger Alsing29-Mar-03 7:29
Roger Alsing29-Mar-03 7:29 
AnswerRe: delegates=strong refs? Pin
Chris Jobson30-Mar-03 5:16
Chris Jobson30-Mar-03 5:16 
GeneralListView to ListView == not so hot Pin
pimponya200029-Mar-03 5:47
pimponya200029-Mar-03 5:47 
GeneralIE-Com Problem Pin
Calamitous28-Mar-03 22:39
Calamitous28-Mar-03 22:39 
GeneralRe: IE-Com Problem Pin
Stephane Rodriguez.28-Mar-03 22:56
Stephane Rodriguez.28-Mar-03 22:56 
Generala problem about a setup project Pin
zamazula28-Mar-03 20:12
zamazula28-Mar-03 20:12 
GeneralDynamincially Adding Controls to a Win Form Pin
siqbal28-Mar-03 12:30
siqbal28-Mar-03 12:30 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone28-Mar-03 13:36
sitebuilderDavid Stone28-Mar-03 13:36 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.28-Mar-03 20:27
Stephane Rodriguez.28-Mar-03 20:27 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 6:23
sitebuilderDavid Stone29-Mar-03 6:23 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
siqbal29-Mar-03 13:41
siqbal29-Mar-03 13:41 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 16:59
sitebuilderDavid Stone29-Mar-03 16:59 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.30-Mar-03 5:42
Stephane Rodriguez.30-Mar-03 5:42 
GeneralInt textBox Pin
blink4me28-Mar-03 9:32
blink4me28-Mar-03 9:32 
GeneralRe: Int textBox Pin
Andreas Philipson29-Mar-03 2:51
Andreas Philipson29-Mar-03 2:51 
GeneralRe: Int textBox Pin
blink4me29-Mar-03 4:59
blink4me29-Mar-03 4:59 
GeneralMime parsing algorithm suggestions requested Pin
Member 9628-Mar-03 8:52
Member 9628-Mar-03 8:52 
Hello, I've inserted below a portion of source code from a non-copyrighted freeware mime parsing algorithm implemented in C# I came across on the internet.

I'm fairly new to c# and I'm finding this algorithm painfully slow and was wondering if anyone had any suggestions for improving this.

It's actually not bad for any email that contains mime entries that are under 300k, but I tested against an email with a multi-megabyte attachment and it took approximately 10 minutes to process it. The slow bit is definitely the part that searches for the boundaries "---" line by line.

Any suggestions would be very welcome. Once I have it working properly and consistently I will post it as an article.

internal ArrayList ParseEntries(MemoryStream msgStrm,int pos,string boundaryID)<br />
		{<br />
			ArrayList entries = new ArrayList();<br />
<br />
			msgStrm.Position = pos;<br />
<br />
			if(boundaryID.Length > 0){<br />
				using(TextReader r = new StreamReader(msgStrm)){<br />
					string line = r.ReadLine();<br />
<br />
					bool   firstFound = false;<br />
					string buffer = "";<br />
					while(line != null){				<br />
						// Next boundary<br />
						if(line.StartsWith("--" + boundaryID)){<br />
							// Add Entry<br />
							if(buffer.Length > 0){<br />
								entries.Add(new MimeEntry(buffer,this));						<br />
							}<br />
														<br />
							firstFound = true;<br />
							buffer = "";<br />
						}<br />
						else{<br />
							if(firstFound){<br />
								buffer += line + "\r\n";<br />
							}<br />
						}<br />
						<br />
						line = r.ReadLine();<br />
					}<br />
				}<br />
			}<br />
<br />
			return entries;<br />
		}

GeneralRe: Mime parsing algorithm suggestions requested Pin
leppie28-Mar-03 11:53
leppie28-Mar-03 11:53 
GeneralRe: Mime parsing algorithm suggestions requested Pin
Member 9628-Mar-03 12:12
Member 9628-Mar-03 12:12 
GeneralC# class Question Pin
econner28-Mar-03 6:32
econner28-Mar-03 6:32 
GeneralRe: C# class Question Pin
leppie28-Mar-03 6:52
leppie28-Mar-03 6:52 
GeneralRe: C# class Question Pin
econner28-Mar-03 6:57
econner28-Mar-03 6:57 
GeneralRe: C# class Question Pin
leppie28-Mar-03 7:10
leppie28-Mar-03 7:10 
GeneralRe: C# class Question Pin
econner29-Mar-03 13:08
econner29-Mar-03 13:08 

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.