Event Triggered Toast Notification UWP

2019-03-02 10:08发布

Idea:I am automating wifi login for a particular network where user have to enter credentials by poping a toast notification like alarm app but instead of snooze or dismiss button there would be login or logout. Issue:How to trigger toast notification immediately when the user connect to a particular wifi network?

Toast

1条回答
地球回转人心会变
2楼-- · 2019-03-02 10:32

You need to use a Background Task which is getting triggered by a System Event - in your case the NetworkStateChanged trigger.

You can then check if you want to show the toast by using Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile()

Look at this question https://stackoverflow.com/a/32846558/5111904 or look up the documentation of the NetworkInformation class for further information.

查看更多
登录 后发表回答