15,896,421 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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...
EnGiNe.Pl
8-Apr-16 16:48pm
View
I'm trying to get rid of this exception for a week and no way to perform it. Maybe you could help with TeamViewer or any other way?
EnGiNe.Pl
8-Apr-16 16:47pm
View
I'll be clear - this solution doesn't work. It makes it happen less often but doesn't solve the problem.
EnGiNe.Pl
6-Apr-16 18:54pm
View
Sorry, I don't understand what you mean and how to fix it. And yes, I don't want the whole loop invoked (I don't know if it works anyway + thread doesn't make sense). I thought about cloning all the HtmlElementCollection but that's almost as difficult as finding how to fix that bug :/
EnGiNe.Pl
6-Apr-16 18:09pm
View
I edited the code in question as shown.
Line:
element = elc[i];
throws sometimes (not always) exception ArgumentOutOfRange.
EnGiNe.Pl
6-Apr-16 17:59pm
View
I will try it out and let you know, however I don't see why this should work since as I said, exception was: "value is 103 and it should be between 0 and 101" so .Count - 1 will make maxValue = 102 which is still beyond the range of <0;101>
EnGiNe.Pl
6-Apr-16 17:36pm
View
What context should I show? That's almost all the code I have.
EnGiNe.Pl
6-Apr-16 15:49pm
View
I thought I got it... but now I'm not sure at all - You said, get indexed property on UI thread, that's what I did - but it didn't resolve the problem at all. I don't get why the hell the value can't be evaluated at the time the debugger throws an exception?! What other code should I post?
EnGiNe.Pl
6-Apr-16 12:39pm
View
for (int i = 0; i < elc.Count; i++)
{
HtmlElement element = null;
element = elc[i];
In the debugger: value is 103 and it should be between 0 and 101, the value of elc.Count can't be evaluated even if I followed your advice and put that invoke inside the code.
EnGiNe.Pl
6-Apr-16 12:38pm
View
Deleted
for (int i = 0; i < elc.Count; i++)
{
HtmlElement element = null;
element = elc[i];
In the debugger: value is 103 and it should be between 0 and 101, the value of elc.Count can't be evaluated even if I followed your advice and put that invoke inside the code.
EnGiNe.Pl
6-Apr-16 11:01am
View
I have tried it:
this.Invoke((MethodInvoker)delegate
{
element = elc[i];
});
but still the same exception... ArgumentOutOfRange
EnGiNe.Pl
16-Mar-14 14:43pm
View
I actually host the website already, and anyone over the internet can see the website using IP. The problem is how to make some data transmission between the website and the client (some type of chat).
Show More