Changed the way it identifies wifi and ethernet up, using netsh data rather than NetworkInformation data,

this appears to be more reliable right now. I probably have a code path where I'm not correctly updating
the NetworkInformation data even though at this point it's only used to identify WiFi vs Ethernet nic.
IPC 0.9.1
Sean McArdle 2016-03-30 13:28:18 -07:00
parent 231f56b230
commit 58d1d43a3b
2 changed files with 4 additions and 3 deletions

View File

@ -83,8 +83,7 @@ namespace WifiSitter
get {
if (Nics == null) return false;
return Nics.Where(x => x.Nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
.Any(x => x.Nic.OperationalStatus == OperationalStatus.Up);
return Nics.Any(x => x.Nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet && x.IsConnected);
}
}

View File

@ -238,7 +238,9 @@ namespace WifiSitter
netstate.UpdateNics(DiscoverAllNetworkDevices(netstate.Nics));
var wifi = netstate.Nics.Where(x => x.Nic.NetworkInterfaceType == NetworkInterfaceType.Wireless80211).Where(x => x.Nic.OperationalStatus == OperationalStatus.Up);
var wifi = netstate.Nics.Where(x => x.Nic.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
.Where(x => x.IsConnected)
.ToArray();
if (netstate.NetworkAvailable) { // Network available
if (netstate.EthernetUp) { // Ethernet is up