Getting profile name from interface

Jul 16, 2013 at 9:23 AM
Hello,

I'm trying to get the current profile name from the interface, but when i do i get this Win32Exception:

The group or resource is not in the correct state to perform the requested operation

This is the code i use.
Wlan.WlanConnectionAttributes attr = this.wlanInterface. <-- this is an WlanClient.WlanInterface object
string profile = attr.profileName;
I run this code in the WlanNotification event of the interface to see if the current connection matches the connection name in the object.


Can i run a code like this in an event? Can an example be shown?
Sep 2, 2013 at 8:52 AM
"The group or resource is not in the correct state to perform the requested operation "

Simply Toggle the Wifi Switch On and off to correct this problem. If you are sharing an Internet connection, make sure that its properly configured.
Sep 3, 2013 at 9:51 AM
Dim wlanIface As WlanClient.WlanInterface = client.Interfaces(0)

TextBox1.Text = wlanIface.CurrentConnection.profileName.ToString()