Click here to Skip to main content
15,896,421 members

Comments by EnGiNe.Pl (Top 16 by date)

EnGiNe.Pl 27-Jun-16 16:29pm View    
I'm sorry for not being precise enough - this must be performed server-side. I updated the question now.
EnGiNe.Pl 16-Apr-16 7:08am View    
Outstanding solution! Thanks a lot.
EnGiNe.Pl 11-Apr-16 11:08am View    
Because as I noticed WebBrowser is changing page (its elements) while being inside loop, so I wanted to lock the whole webBrowser1 control, but it doesn't work. My other idea is to use webBrowser1.Stop() just before getting into loop so the elements remain unchanged but I can't figure out way to "resume" it later.
EnGiNe.Pl 9-Apr-16 12:56pm View    
It seems that WebBrowser is changing content while inside for loop. Please see my last answer to Matt T Heffron.
EnGiNe.Pl 9-Apr-16 8:52am View    
When using foreach it crashes like every 2 minutes on "in elc" (foreach header)
When using for (int i = 0; i < elc.Count - 1; ++i) It crashes less often (every 30 minutes), but still on line:
HtmlElement element = elc[i];

The reason for different frequency of crashing is due to range it exceeds. The usual exception says:
- "Value of '102' is not valid for 'index'. 'index' should be between 0 and 101."
- Value of '103' is not valid for 'index'. 'index' should be between 0 and 101.

Foreach loop throws an exception for both these cases, whilst "for (int i = 0; i < elc.Count - 1; ++i)" for only one of them (exceeded by 2 elements).

I tried both versions with Invoke and with Invoke removed.
HtmlElementCollection.GetEnumerator() method fails to work for the same reason - ArgumentOutOfRange

Using the lock statement doesn't change anything. It seems that website content gets changed during iteration of loop but the lock keyword doesn't work. I already tried: "lock (elc)", "lock (webBrowser1)", "lock (myObject)" and so on...