C#
|
|
 |

|
Update - I was able to achieve this by removing the IF and using the following.
var myvar = shell.Runspace.SessionStateProxy.GetVariable("myvar");
myLabel.Text = Server.HtmlEncode(myvar.ToString());
|
|
|
|

|
How can we disable and enable the internet from inside of our program?
|
|
|
|

|
Fred 34 wrote: disable and enable the internet
It is highly unlikely that you are going to be writing a program that can disable or enable the internet so you must mean something else.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|

|
In fact I want to disable internet for awhile to prevent spyware to access that sensitive portion of program which contains some personal information which is not coded yet. for example account number which is coming from keyboard.
|
|
|
|

|
How is that going to help? My keylogger doesn't send data when it is entered, it sends it at midnight.
Think again.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|

|
An utter waste of time. It doesn't matter if the machine has internet access or not. Malware is still going to get this information and hang onto it until it CAN send it.
|
|
|
|

|
U are right, I did not think about it in this way.
|
|
|
|

|
Well there are 2 crude ways to do it: (if you haven't written drivers for your connectivity interfaces )
1. Enumerate all the network interfaces (non-virtual) and disable them
2. Configure a non-existent proxy server (like 0.0.0.0 port 80) for time being. After you are done with your execution reset this dummy proxy. Ensure you can backup any existent proxy settings if any.
Sunil
|
|
|
|

|
#Define "The Internet".
You could disable every TCP/IP adapter on my machine, if you ran under an administrative account. Then again, maintenance and support might become angry if my internet doesn't work for no good reason.
Keep in mind that Windows Update and the virusscanner would be affected to.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|

|
Fred 34 wrote: How can we disable the internet ...
Sorry, I'm not going to hand you that code; would some launch codes for a nuclear missile be sufficient?
For most CP members, life would be quite different without Google, MSDN, CodeProject, and many more.
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin