C# How to monitor WiFi connection in WPF?

Jeff Nygren 121 Reputation points
2020-08-06T19:16:49.547+00:00

I have a C# WPF desktop application that connects to a camera via WiFi, and downloads pictures to a 'HotFolder'. If the camera is moved too far from the PC, the WiFi disconnects. How can I monitor the WiFi connection?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. DaisyTian-1203 11,626 Reputation points
    2020-08-07T02:56:55.197+00:00

    Do you want to monitor the camera WiFi's connection? How did you implement the WiFi part in your WPF application? Did you use the UWP API? If you did, do you use Windows.Devices.WiFiDirect to download the file from the camera? If you use Windows.Devices.WiFiDirect,you seems no need to minitor the Wifi connect, you can use ConnectionStatus to get the connection status for the WiFi-Direct device.You can add a handler for the ConnectionStatusChanged event to be notified when the connection has been established or disconnected.You could refer to WiFiDirectDevice for more details.If I misunderstand the question, please point out and give me more details to analyze.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.