i'm new to .NET Framework 3.5. Currently in my C# Project i'm using Smart Device Framework
.
My task is to enable wifi connectivity on a button click in a Windows Form as to (Synchronize the mobile with the Web part i.e to get data from Web to Mobile)
In Windows Mobile 5.0 Pocket PC
i don't see any option for WLAN connections in
settings --> Connections
Following are the List of Network Adaptors showing in the Windows Mobile 5.0 Pocket PC I see when searched
I configured with NE2000 Compatible Ethernet Driver. Am I going the right way ?
Also I have added OpenNETCF.net library
in the Reference of the Project
i took help from other stack overflow links and a microsoft documentation:
Building a Wi-Fi Discovery Application
Below is the code snippet :
/// Check available network interfaces
foreach (OpenNETCF.Net.NetworkInformation.INetworkInterface networkInterface in OpenNETCF.Net.NetworkInformation.WirelessNetworkInterface.GetAllNetworkInterfaces())
{ /// network interface i get NE20001
if (networkInterface.Description.Equals("NE20001"))
{
/// Display current configurations
textBox1.Text += ("Description: " + networkInterface.Description + "\r\n");
textBox1.Text += ("IP: " + networkInterface.CurrentIpAddress + "\r\n");
textBox1.Text += ("ID: " + networkInterface.Id + "\r\n");
textBox1.Text += ("Status: " + networkInterface.InterfaceOperationalStatus + "\r\n");
networkInterface.Bind();
try
{
INw = (OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface)networkInterface; ///< Obtain wireless zero configuration interface }
catch
{
textBox1.Text = "Network interface is not Wireless Zero Configuration"; ///< Possible reason can be that image in WinCE 7
}
accessPointCollection = INw.NearbyAccessPoints;
textBox1.Text += ("Wireless Network available are:\r\n");
/// Get available wireless network
foreach (OpenNETCF.Net.NetworkInformation.IAccessPoint iAccessPoint in accessPointCollection)
{
comboBox1.Items.Add(iAccessPoint.Name);
textBox1.Text += (iAccessPoint.Name + " - signal strength: " + iAccessPoint.SignalStrength + " (" + iAccessPoint.SignalStrength.Decibels + "dB)\r\n");
}
}
}
i get INw value NULL
below, because it has no WirelessZeroConfigNetworkInterface.
INw = (OpenNETCF.Net.NetworkInformation.WirelessZeroConfigNetworkInterface)networkInterface;
So INw.NearbyAccessPoints is not possible for WirelessZeroConfigNetworkInterface.
1) How to configure WIFI connections
in Windows Mobile 5.0 Pocket Pc in .NET3.5
2) How to know if in current Windows Mobile 5.0 Pocket Pc the wifi is enabled or not.
3) Am i going wrong somewhere in my above code i.e is WirelessZeroConfigNetworkInterface required for enabling wifi ?
Any suggestions would be really helpful.