2

How do i setup a wireless ad-hoc network to Windows Mobile 6.1 on startup? I think the only way to do this is programmatically and I have been unable to find a way to create a network, I have found OpenNetCF but is there a way to do this in .NET CF? Or how-to do it in OpenNetCF?

I need to do this so I can have socket communications.

4

1 回答 1

2

Ad-hoc 的另一个名称是“非基础架构模式”,因此如果您查看我在此处提供的一些示例服务代码,您会看到如下所示的私有方法:

private bool ConnectToNetwork(
    string ssid, 
    string passphrase, 
    bool adhoc, 
    AuthenticationMode mode, 
    WEPStatus encryption)
{
    // other setup code, etc
                return m_wzc.AddPreferredNetwork(ssid,  
                    !adhoc,  
                    passphrase,  
                    1,  
                    mode,  
                    encryption,  
                    eap);  
}

注意它是如何将基础架构模式的 bool 参数作为第二个参数传递的。您只需添加另一个调用 ConnectToNetwork 的公共方法,将其设置为 true(服务中的每个方法现在都传递 false,因为我在编写代码时没有 Ad-hoc 作为要求)。

于 2013-01-18T13:58:08.990 回答