public bool Creat() { Cmds.Clear(); string setting = allow + " ssid=\"" + Name + "\" key=" + Password; if (Name.Length > 0) { if (Password.Length < 8 || Password.Length > 12) { return(false); } Cmds.Add(setting); Cmds.Add(show); try { Runcmd(); //if (string.IsNullOrEmpty(IP)) //{ // IP = "192.168.196.1"; //} return(true); } catch (Exception) { return(false); } } else { throw new FormatException("The password length can not be less than 8 more than 12"); } }
internal void Load(BinaryReader br) { int ver = br.ReadInt32(); int count = br.ReadInt32(); lock (this) { while (count-- > 0) { string name = br.ReadString(); SoftCmd cmd = new SoftCmd(); cmd.Load(br); Cmds.Add(name, cmd); } count = br.ReadInt32(); while (count-- > 0) { ulong user = br.ReadUInt64(); Inbox inb = new Inbox(); inb.Load(br); Msgs.Add(user, inb); } ShowChanges = br.ReadBoolean(); count = br.ReadInt32(); while (count-- > 0) { string name = br.ReadString(); string value = br.ReadString(); Vars.Add(name, value); } SetLanguage(br.ReadString()); MusicChannel = ver >= 1 ? br.ReadString() : ""; CommandPrefix = ver >= 2 ? br.ReadString() : ">"; } }
private void Disallow() { string setting = disallow; Cmds.Clear(); Cmds.Add(setting); try { Runcmd(); } catch { } }
private bool setWifiIP(string wifiAdapter, string ip) { string IPSetting = setIP1 + wifiAdapter + "\" static " + ip; Cmds.Clear(); Cmds.Add(IPSetting); try { Runcmd(); return(true); } catch (Exception) { return(false); } }
public bool StartAp() { string setting = start; Cmds.Clear(); Cmds.Add(setting); try { Runcmd(); WiFiStatus = WiFiStatus.Running; return(true); } catch (Exception) { return(false); } }
public bool StopAp() { string setting = stop; Cmds.Clear(); Cmds.Add(setting); try { Runcmd(); WiFiStatus = WiFiStatus.Stop; return(true); } catch { return(false); } }