Open jomanu85 opened 8 years ago
THX, i had to include the namespace:
using System.Net;
And i used the class WebUtility because my application is no webapplication ;)
string name = WebUtility.HtmlEncode(Encoding.ASCII.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength));
See #45. I opted to use SecurityElement.Escape as this only escapes XML affected characters.
However, I found escaping the ssid name on its own wasn't sufficient for more exotic SSIDs (even using full html entity encoding). To fix connection for those, I had to also include the hex key in the profile to connect to those.
I was trying to connect to my WLAN, which got an '&' in its name.... But it simply never worked... After a while (was already getting my head around the Managed Wifi API) I got the Idea to try it with a SSID Name not containing any special characters... et voila, this worked.
So in order to get the Simple Wifi API to work also with more exotic SSIDs simply add a HttpUtility.HtmlEncode() around the name in ProfileFactory.cs.
string name = HttpUtility.HtmlEncode(Encoding.ASCII.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength));
Hope this is usefull to anybody :)