C #: WiFi via Window API interface

Source: Internet
Author: User

1. Get MAC Address

//WiFi Notification Callback        PrivateWlanapi.wlan_notification_callback _notificationcallback; This. _notificationcallback =NewWlanapi.wlan_notification_callback ( This.            Onnotification);            Wlan_notification_source Notifsource; Wifiapiutils.throw_on_win32_error (Wlanapi.wlanregisternotification ( This. _wlanhandle, Wlan_notification_source. All,true, This. _notificationcallback, IntPtr.Zero, IntPtr.Zero, outNotifsource)); protected voidOnnotification (refwlan_notification_data Notifdata, INTPTR context) {            Switch(notifdata.notificationcode) { Case(int) Wlan_hosted_network_notification_code.wlan_hosted_network_state_change://when the network status changes                     Break;  Case(int) Wlan_hosted_network_notification_code.wlan_hosted_network_peer_state_change://log or delete information such as the client's MAC address when the client accesses or exits WiFi                    if(Notifdata.datasize >0&& Notifdata.dataptr! =IntPtr.Zero) {Wlan_hosted_network_data_peer_state_change Ppeerstatechange = (Wlan_hosted_network_data_peer_state_change) marshal.ptrtostructure (Notifdata.dataptr,typeof(Wlan_hosted_network_data_peer_state_change)); if(PPeerStateChange.NewState.PeerAuthState = =wlan_hosted_network_peer_auth_state.wlan_hosted_network_peer_state_authenticated) {                            //Station joined the hosted network                             This. Onjoinwifi (ppeerstatechange.newstate); }                        Else if(PPeerStateChange.NewState.PeerAuthState = =wlan_hosted_network_peer_auth_state.wlan_hosted_network_peer_state_invalid) {                            //Station left the hosted network                             This. Onleavewifi (ppeerstatechange.newstate); }                        Else                        {                            //Authentication state Changed                        }                    }                     Break; }        }
View Code

Reference URL:


Https://msdn.microsoft.com/en-us/library/windows/desktop/ms706556%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/dd439495 (v=vs.85). aspx

Https://code.yhzm.me/shenchao/test_shen
http://start.firefoxchina.cn/
http://blog.csdn.net/lincyang/article/details/34430939
https://msdn.microsoft.com/en-us/library/windows/desktop/ms706556 (v=vs.85). aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms706749 (v=vs.85). aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa816369 (v=vs.85). aspx
http://xjchilli.blog.163.com/blog/static/4534773920120161126917/
http://managedwifi.codeplex.com/discussions/12073
http://managedwifi.codeplex.com/
Http://www.codeproject.com/Articles/35329/How-to-access-wireless-network-parameters-using-na
https://social.msdn.microsoft.com/search/en-us/windows?query=WiFi&Refinement=183
Http://cn.bing.com/search?q=c%23+wifi+api&FORM=QSRE2
http://blog.csdn.net/hgy413/article/details/20784277
Http://stackoverflow.com/questions/25808620/c-sharp-connect-to-wifi-network-with-managed-wifi-api
Http://managedwifi.codeplex.com/SourceControl/changeset/view/41381#WlanApi.cs
https://msdn.microsoft.com/en-us/library/windows/desktop/ms706771 (v=vs.85). aspx
Https://msdn.microsoft.com/en-us/library/windows/desktop/aa816369%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/ms706771 (v=vs.85). aspx
Http://pietschsoft.com/archive#cat-C
Http://www.baidu.com/baidu?wd=WlanHostedNetworkForceStart&tn=monline_dg
Http://wenku.baidu.com/view/bee10913866fb84ae45c8d9c.html
Http://wenku.baidu.com/view/5317412ecf84b9d528ea7a70.html


A git reference is also included:
Http://www.ruanyifeng.com/blog/2015/08/git-use-process.html
Http://www.ruanyifeng.com/blog/2012/07/git.html
Http://cn.bing.com/search?q=%2bgit+%e4%bd%bf%e7%94%a8+ruanyifeng&filters=rcrse%3a%221%22&FORM=RCRE
Http://www.cnblogs.com/GT_Andy/archive/2009/04/23/1922094.html
Http://jingyan.baidu.com/article/4b07be3c73400048b280f356.html

C #: WiFi via Window API interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.