Programmatically enable/disable a network interface?
I am trying to write in a 'self fixer' to a program to fix an issue with wireless connectivity over a long time.
Namely, it seems that over time, wireless connections always seem to drop. The fix always being disabling and re-enabling the connection. As I know what this fix is, how can I write it into the software to do it itself should it need to?
My idea was this:
Normal activity of the program fails for whatever reason. In the try/catch block, it would check to see if the device was active, if it wasn't, enable it, run a ping and based on the result of that, try again.
However, every reference to doing this I come across is like running into a big Microsoft shaped wall.
Does anybody have any ideas as to API calls within Windows XP which I can use to do a simple enable/disable of a named connection? It seems that you can do it in Vista, but the devices I'm working with are embedded systems and therefore, no Vista (not to mention they only have 256Mb RAM).