---
import std.process;
import core.thread;
import std.random;

void main(string[] args)
{
string on = "netsh interface set interface \"Connexion au réseau local\" Enable"; string off = "netsh interface set interface \"Connexion au réseau local\" Disable";

    while(true)
    {
        executeShell(on);
        Thread.sleep(dur!("msecs")(uniform(2000, 5000)));
        executeShell(off);
        Thread.sleep(dur!("msecs")(2000));
    }
}
---

It's stable if i remove the random time after connecting, otherwise in the current shape it crashes Windows. Don't know why. Any idea ?

Note that you can test by replacing the name of my interface by yours ('Connexion au réseau local').

Reply via email to