예제 #1
0
        /// <summary>
        /// Удаление профиля соединения
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void DeleteProfile(object sender, EventArgs e)
        {
            if (listNet.SelectedIndices.Count == 1)
            {
                int number = listNet.SelectedIndices[0];

                AccessPoint selectedAP = accessPoints.ToList()[number];

                selectedAP.DeleteProfile();
                showRichTextBox2.Text += string.Format("\r\n-> Удален профиль для точки: {0}\r\n", selectedAP.Name);
            }
        }
예제 #2
0
파일: DLG_Wifi.cs 프로젝트: luckypal/Kiosk
        private bool DeleteProfile(string _name)
        {
            IEnumerable <AccessPoint> source = List();

            for (int i = 0; i < source.ToArray().Length; i++)
            {
                if (source.ToList()[i].Name.ToLower() == _name.ToLower())
                {
                    AccessPoint accessPoint = source.ToList()[i];
                    accessPoint.DeleteProfile();
                    return(true);
                }
            }
            return(false);
        }
예제 #3
0
        static void DeleteProfile()
        {
            var accessPoints = List();

            Console.Write("\r\nEnter the index of the network you wish to delete the profile: ");

            int selectedIndex = int.Parse(Console.ReadLine());

            if (selectedIndex > accessPoints.ToArray().Length || accessPoints.ToArray().Length == 0)
            {
                Console.Write("\r\nIndex out of bounds");
                return;
            }
            AccessPoint selectedAP = accessPoints.ToList()[selectedIndex];

            selectedAP.DeleteProfile();
            Console.WriteLine("\r\nDeleted profile for: {0}\r\n", selectedAP.Name);
        }
예제 #4
0
        private async Task connect(AccessPoint ap, string password)
        {
            ap.DeleteProfile();
            bool        str = false;
            AuthRequest ar  = new AuthRequest(ap);

            ar.Password = password;
            try
            {
                str = await Task.Run(() => ap.Connect(ar));

                //str = ap.Connect(ar);
            }
            catch
            {
            }
            Console.WriteLine(ap.ToString() + ar.Password + str);
            if (str)
            {
                Environment.Exit(0);
            }
        }