private void btnSwitch_Click(object sender, EventArgs e) { if (_wlnMgr.IsHostedNetworkStarted) { _wlnMgr.StopHostedNetwork(); } else { _wlnMgr.StartHostedNetwork(); } }
private bool StopInternal(bool verbose) { try { Status = WorkingStatus.Stopping; DisableSharing(true); _wlanManager.StopHostedNetwork(); #if TRACE LogExceptions.LogTrace(true, "WLanStop->Done"); #endif if (verbose) { Status = WorkingStatus.Stopped; } return(true); } catch (Exception ex) { LogExceptions.Log(ex); Status = WorkingStatus.StopFailed; return(false); } }
/// <summary> /// Останавливает точку доступа /// </summary> /// <returns>true, если точка доступа успешно остановлена; false, если возникла ошибка. Вызовите GetLastError(), чтобы получить результат ошибки</returns> public bool Stop() { try { if (_icsManager.SharingInstalled) { _icsManager.DisableIcsOnAll(); } _wlanManager.StopHostedNetwork(); return(true); } catch { return(false); } }