打开wifi后,如何连接指定的网络

yzbsd 2009-10-15 04:08:20
已经打开wifi,并且找到网络了,怎么才能连接到指定的网络呢,如果包含密码应该如何传递密码?还有就是怎么判断网络已经连接好了?
...全文
578 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoshu666 2011-03-14
  • 打赏
  • 举报
回复
Hi, i'm Daniel and i have a question. Do yo know about wifi network connection with addPreferrednetwork method? This is from Opennetcf.Net.NetworkInformation class. I'm making a code to connect my PDA (HP iPAQ 216 Enterprise) with a AP Cisco WAP200. I'm using the follow code on C#:

addpreferrednetwork("SSID", true, "key", 1, authmode, wepstatus, eapparameters);

If connec with OpenSystem and WEPEnabled its ok. But if connect with WPA2PSK and AESEnalbed or TKIPEnalbed then i can connect and add networ bat not internet acces.

Here partial code on C#.

public void Connecting()

{

bool estado;

INetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();


foreach (NetworkInterface nInterface in allNetworkInterfaces)
{
if (nInterface is WirelessZeroConfigNetworkInterface)
{
WirelessZeroConfigNetworkInterface interface = (WirelessZeroConfigNetworkInterface)nInterface;
estado= interface.AddPreferredNetwork("SSID", true, "11111111", 1, AuthenticationMode.WPA2PSK, WEPStatus.AESEnabled, null);


if (estado)
{
//Here refence other object

objConnect.Connect();
}
else
{

}
}

}

If setting wifi network manually with some date (WPA2, AES, Pass and SSID) then it's ok internet access, but if connecting programatically then no way of internet access. It's ok all setting and authentique SSID but not internet.

Know Sombody about this?

May be error of password? or Encripting?

Thank you to answer!
-------------------------
这是我查到的,试验了下,可以连接wpa加密的
sunboyljp 2009-10-16
  • 打赏
  • 举报
回复
wzcsapi.h这个头文件
yzbsd 2009-10-15
  • 打赏
  • 举报
回复
Zero config API?
什么意思,msdn没找到相关函数啊
儿大不由爷 2009-10-15
  • 打赏
  • 举报
回复
Zero config API 看看

7,660

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧