1

I am working with a WPF app for tablets with Windows 8.1. The app connects to SAP. In the settings I have to implement an option for synchronisation to only occur over a WiFi network.

How can I determine if the tablet is connected to WiFi or a cellular network? From my research I have found ways to do this on XP and Vista or using Universal Apps. How can I implement this feature using WPF and Windows 8.1?

Timothée Bourguignon
  • 2,190
  • 3
  • 23
  • 39
Dragos Stoica
  • 1,753
  • 1
  • 21
  • 42
  • Possible duplicate: http://stackoverflow.com/questions/28852810/how-can-i-determine-whether-i-am-connected-to-wifi-or-a-mobile-network-in-window ? – Timothée Bourguignon Sep 10 '15 at 11:49
  • not duplicated, Windows.Networking.Connectivity not accesible in WPF, I need a solution for wpf – Dragos Stoica Sep 10 '15 at 11:50
  • That should have nothing to do with WPF, just add the correct assemblies to your project for using the class... – BendEg Sep 10 '15 at 11:54
  • Are you sure? The [msdn](https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.connectionprofile.aspx) page about ConnectionProfile says "Minimum supported client - Windows 8 [Windows Store apps, desktop apps]"... – Timothée Bourguignon Sep 10 '15 at 11:55
  • You think is no difference between .NET Framework 4.6 and .NET CORE? I cannot add the dll in a WPF application. – Dragos Stoica Sep 10 '15 at 11:56
  • for Tim Boutguignon check this : https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.connectionprofile.iswlanconnectionprofile.aspx is availble for Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps] – Dragos Stoica Sep 10 '15 at 11:57
  • hope this will help you, http://stackoverflow.com/questions/19435482/get-notified-when-internet-is-connected-or-disconnected – Awn Ali Sep 10 '15 at 11:59
  • I found this Awn Ali, but they are talking about connection, not the type of the connection. I have to identify somehow if the network is wlan or not. Thank you for your help – Dragos Stoica Sep 10 '15 at 12:03
  • @DragoshStoica: in the link you provided, the method is explicitely flagged as available for Windows 8.1, not just WP8.1. I honestly don't see why it should not work. – Timothée Bourguignon Sep 10 '15 at 12:29
  • just try to make a wpf application and try to find the assembly, you will see that is not available, or class library, whatever with .net framework 4.5 or 4.6 – Dragos Stoica Sep 10 '15 at 12:33
  • Boy boy boy, I finally understood where you threw me off. When you say "WPF App for Windows 8.1 tablets", I picture a Modern App. But when you are creating is a "WPF Desktop Application", nothing to do with Windows 8.1, or tablets for that matter, "WPF" is the key information. Ok in that case the above mentioned API does not work. – Timothée Bourguignon Sep 11 '15 at 15:15

0 Answers0