ADBlock sta bloccando alcuni contenuti del sito

ADBlock errore


I'm assuming that you are putting a breakpoinit in the myPing_PingCompleted method but that when in debug mode its just not going there. Is that right?

Is the code throwing some sort of error? If you step through the code, does it call the myPing.SendAsync with the right parameters?

I just tried your code (without the IPQueue because that looks like your custom class). It works fine on my end. I used one valid IP and what IP that doesn't exist. It worked good in both cases.

Edit for new information

Ok i just tried it in a windows form application and IT DOES NOT WORK. When i tried it before it was in a unit test. Basically it would seem that the thread used to render the windows form and handle the events isn't capable of being used to create async requests (maybe because it is a foreground thread). But, you can get arround it pretty easily by creating another thread to do the ping.

Actually, ideally that's how you would have to do it anyways. In order for the windows form app not to lock up when the thread is busy, a good principle is to do all backround work on a seperate thread. This would keep the windows form responsive. Be careful though, when trying to access Controls using backround threads an exception will be thrown. It is best to read all the values you want into private variables and then kick of a thread that will do all the work, have that thread update another set of variables and then have the forground thread read the variables and update the controls.