Is there a way to check if the wireless is already enabled?

  • Thread starter Thread starter mosh707
  • Start date Start date
M

mosh707

I am writing a code that is supposed to check if the wireless is
enabled or not and then according to the given status it turns it On or
Off. I am using the fuction \Windows\WirelessOnOff.exe this fuction
reservers the current state, i.e if it is enabled it disable it and
vice versa. However I cannot tell if it was orginally disabled or
enabled to decide whether to call this fuction or not. I also tried to
look in Microsoft.WindowsMobile.Status API but I could find a way to
check for wireless. If you know a way to do that please help.
 
You can tell if there is a wireless adapter in the list of adapters for the
device. Since the executable you mention and that method of 'disabling'
wireless is completely non-standard, I don't think that I can tell you what
will work and what won't. Look at OpenNETCF.Net to get a list of adapter
objects. Check each one for IsWireless or similar property. If you find
one which is wireless, that probably indicates that wireless is on; if not,
I'd say that either the device has no wireless or it is disabled.

Paul T.
 
Back
Top