Hello i have a problem.

I have a program which is supposed to download a file in a seperate thread, while the program checks file size. However i get this error when i try to debug (F5):

Object reference not set to an instance of an object.

Code: http://pastebin.com/7QkyJYf7

Recommended Answers

All 4 Replies

On which line do you get this error? Is it maybe on line 33 in this line of code:

Timer1.Interval = 100

It seems you didnt initialize a new timer. On form load (or in constructor) instanitate a new instance of a timer:

Dim Timer1 As New Timer()

atleast provide the exception statement
use try catch

On which line do you get this error? Is it maybe on line 33 in this line of code:

Timer1.Interval = 100

It seems you didnt initialize a new timer. On form load (or in constructor) instanitate a new instance of a timer:

Dim Timer1 As New Timer()

I made the timer in the form.

Where exactly do you get this error? Use a debugger (set a break point to check on whcich line error occurs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.