The question make no sense at all, but it looks really troublesome. I really want to seriously warn you.
Let's apply some logic to what you say. Your "the program works fine" when your computer is disconnected to the Internet indicated that your application does not use the Internet. And yet, if you just connect to the Internet, it strongly slows down. Why? I would assume that if you voluntary executed some code actively using Internet which takes up essential part of your system resources as well (CPU time, first of all), you would not ask this question.
Therefore, what your observations, only if they are correct and are formulated correctly,
strongly suggest that you may run some malicious software on your system and are unaware of that. Be very careful. Stop all you are doing and inspect your system and try to use some malicious software removing tool, preferably from some bootable rescue disk. Please see:
http://en.wikipedia.org/wiki/List_of_data_recovery_software#Bootable[
^].
But, frankly, in such case I would rather rebuild entire system from scratch.
—SA