문제

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.

도움이 되었습니까?

해결책

Another name for Ad-hoc is "not Infrastructure Mode", so if you look at some of the example service code that I have here, you'll see a private method that looks like this:

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);  
}

Notice how it's passing the bool parameter for infrastructure mode as the second parameter. You simply need to add another public method that calls into ConnectToNetwork that sets this to true (every method in the service right now passes false because I didn't have Ad-hoc as a requirement when I wrote the code).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top