wifi on/off

  • Thread starter Thread starter Alberto Garcia Sanchez
  • Start date Start date
A

Alberto Garcia Sanchez

Hi

I have seen this code to swicht on off wifi slot. My questions is there are anybody can traslate to vb.net or csharp this code source.

many may thanks


__declspec(dllexport) BOOL WINAPI PowerOn(void)
{
if (DevicePowerNotify(_T("WLP1:"), D0, POWER_NAME) != 0)
return FALSE;

return TRUE;
}

__declspec(dllexport) BOOL WINAPI PowerOff(void)
{
if (DevicePowerNotify(_T("WLP1:"), D4, POWER_NAME) != 0)
return FALSE;

return TRUE;
}



_______________________________

* Alberto García Sánchez
* Subdirector Informática
* Autobar Spain, S.A.
* Email: (e-mail address removed)
* Web: www.autobar-spain.com
* Telef. +34 916787345
_______________________________


___________________________________________________________________________
Este mensaje se dirige exclusivamente a su destinatario
y puede contener información privilegiada o confidencial. Si no es vd. el destinatario
indicado, queda notificado de que la utilización, divulgación y/o copia sin
autorización está prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.

This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly
prohibited by law. If this message has been received in error, please
immediately notify us via e-mail and delete it.
___________________________________________________________________________
 
Here you are declarations to implement these functions:

const int POWER_NAME = 1;
enum CEDEVICE_POWER_STATE
{
D0 = 0,
D4 = 4
}

[DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string device,
CEDEVICE_POWER_STATE state, int flags);

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
Back
Top