Exemple #1
0
        private static void WifiZoneFlow(
            List <string> current_near_wifis,
            List <string> latest_ruleset,
            Action insideBlockZone, Action outsideBlockZone, Action <List <string> > updateRules
            )
        {
            if (current_near_wifis.Count > 0)
            {
                List <string> newRuleSet = new List <string>();
                string        reason     = "init";
                if (WifiHelper.fastBlockZoneCheck(current_near_wifis, latest_ruleset, out newRuleSet, (text) => log(text), out reason))
                {
                    // Update all rules with bad ones:

                    // TODO: get new rules by call not changing them

                    updateRules?.Invoke(latest_ruleset);
                    log("Reason blocked: " + reason);
                    insideBlockZone?.Invoke();
                }
                else
                {
                    outsideBlockZone?.Invoke();
                }
            }
            else
            {
                log("Found 0 wifis, assume blockzone");
                insideBlockZone?.Invoke();
            }
        }
Exemple #2
0
        public List <string> TestWifiBlocked(bool inBlockZone, List <string> current, List <string> rules)
        {
            List <string> newRules;
            string        reason = "";

            Assert.AreEqual(inBlockZone, WifiHelper.fastBlockZoneCheck(
                                current, rules, out newRules, (s) => Console.WriteLine(s), out reason
                                ));
            return(newRules);
        }
Exemple #3
0
        private void btnFindWifi_Click(object sender, EventArgs e)
        {
            if (cbxWifiNames.SelectedIndex == 0)
            {
                return;
            }

            var wifiName     = cbxWifiNames.SelectedItem?.ToString();
            var wifiPassword = WifiHelper.GetPwdOfWifi(wifiName);

            ShowMessageBox("Şifre", wifiPassword);
        }
        public LoginPage(ILoginManager loginmanager)
        {
            InitializeComponent();

            loginManager = loginmanager;

            wifiHelper = new WifiHelper();
            wifiHelper.CheckWIFI();

            settings  = new Settings();
            User.Text = settings.UserID;
            //Password.Text = settings.UserPass;
            //if (settings.SignedUp == true)
            //    Task.Run(() => LoginSuccessfull());
        }
Exemple #5
0
 private void SetCbxWifiNames()
 {
     cbxWifiNames.Items.Insert(0, "-- Wifi Seçin --");
     cbxWifiNames.Items.AddRange(WifiHelper.GetWifiNames().Cast <object>().ToArray());
     cbxWifiNames.SelectedIndex = 0;
 }