I need to disable network connection programmatically.
Is this Possible in Windows Mobile 6.5?
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.