简体   繁体   中英

Disabling Internet in Windows Mobile 6.5

I need to disable network connection programmatically.

Is this Possible in Windows Mobile 6.5?

您可以尝试IOCTL_NDIS_UNBIND_ADAPTER

Look into the SystemState variable. You can read from it, wire up events, and set to it.

Define a SystemState variable, like ncs :

  SystemState ncs= new SystemState(SystemProperty.ConnectionsCount, false);
  ncs.Changed += new ChangeEventHandler(network_Changed);

Now, work with the events:

void network_Changed(object sender, ChangeEventArgs args) {
  int connections = (int)args.NewValue;
  Console.WriteLine(connections);
}

A simple Microsoft example is >>HERE<< .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM