-
September 18th, 2012, 12:30 AM
#1
[C#] Adding Event Listener to static void Main() fails, why?
Hi All,
Trying to download some strings from a webpage, then fires an event for each download that completes. However, when trying to add the event listener, the program throws the following error:
An object reference is required for the non-static field, method, or property 'Test.Program.client_OpenReadCompleted(object, System.Net.OpenReadCompletedEventArgs)'
Code is here: http://codepad.org/mAZVd4DJ
The line with the error is line 22.
How can I get around this?
Please let me know if you require more information, thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|