[DllImport("wlanapi.dll")]
public static extern int WlanConnect(
[In] IntPtr clientHandle,
[In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid,
[In] ref WlanConnectionParameters connectionParameters,
IntPtr pReserved);
想知道怎么可以调用成功
//断开网络
public void Disconnect()
{
IntPtr _clientHandle = whc.WlanOpenHandle(1);
NetworkInterface[] _interface = NetworkInterface.GetAllNetworkInterfaces();
Guid netIfaceGuid = new Guid(_interface[0].Id);
WlanDisconnect(_clientHandle, netIfaceGuid, IntPtr.Zero);
whc.WlanCloseHandle(_clientHandle);
}
//断开网络
public void Disconnect(NetworkInterface _interface)
{
IntPtr _clientHandle = whc.WlanOpenHandle(1);
Guid netIfaceGuid = new Guid(_interface.Id);
WlanDisconnect(_clientHandle, netIfaceGuid, IntPtr.Zero);
whc.WlanCloseHandle(_clientHandle);
}
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息