API(Application Programming Interface,應用程序編程接口)是一些預先定義的函數,目的是提供應用程序與開發人員基於某軟件或硬件得以訪問一組例程的能力,而又無需訪問源碼,或理解內部工作機制的細節。
Windows API
linux API
我現在在做一個一鍵發送WIFI的MFC程序,我現在要解決幾個問題。
1.我想做個好看的界面,這裏面5,6,7,8應該用的上。
2.我想調用CMD命令的時候把那個去黑屏去掉,應該用的到2?10?12?
3.我想把手動適配器共享那一步自動化,那麼我應該要用到10,12要嗎?
如果有錯,請指教。
我這裏我選出一段 一鍵WIFI MFC程序 建立的代碼,開關WIFI代碼就可以自己想出來了。現在的問題是我要去掉這個黑屏,也就是不用system(""),還有我要調用適配器。
void CWIFIDlg::OnCreat()
{
// TODO: Add your control notification handler code here
CWIFiSEND wifisend;
if(wifisend.DoModal() == IDOK)
{
if(!strlen(wifisend.m_wifi_account) || !strlen(wifisend.m_wifi_psd1) || !strlen(wifisend.m_wifi_psd2))
{
MessageBox("u should text every column");
}
else if(strcmp(wifisend.m_wifi_psd1,wifisend.m_wifi_psd2))
{
MessageBox("psds u input are not same");
}
else
{
char sstring[100];
sprintf(sstring,"netsh wlan set hostednetwork mode=allow ssid=%s key=%s",wifisend.m_wifi_account,wifisend.m_wifi_psd1);
system(sstring);
}
}
}
有興趣和我把這個小程序一起做下去的,可以加羣457555870一起交流。