Exemplo n.º 1
0
 public void DeleteCurrentPage()
 {
     pages.Remove(page);
     ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                       "Page: " + page.Name + " has been succesfully deleted"));
     page = pages.Count > 0 ? pages[0] : null;
 }
Exemplo n.º 2
0
        public async Task ReadPagesFromFile(string path)
        {
            ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                              "Started reading default pages from file" + path));
            FileStream file   = new FileStream(path, FileMode.Open, FileAccess.Read);
            var        reader = new StreamReader(file);

            do
            {
                string _filePath = await reader.ReadLineAsync();

                try
                {
                    _filePath = string.Format("{0}\\Files\\{1}", path.Substring(0, path.LastIndexOf('\\')), _filePath);
                }
                catch (Exception)
                {
                    throw new Exception("Path for login page file was incorrect");
                }
                LoginCore newPage = new LoginCore(ChangeUI);
                await newPage.InitializeFromFile(_filePath);

                pages.Add(newPage);
            } while (reader.Peek() >= 0);
            reader.Dispose();
            file.Dispose();
            page = pages[0];
            ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                              "Finished reading default pages from file" + path));
            ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                              page.Name + " has been set as default brute page"));
        }
Exemplo n.º 3
0
 public void SetPage(LoginCore page)
 {
     editingPage             = page;
     txtPageName.Text        = page.Name;
     txtPostString.Text      = page.postPattern;
     txtIndicateString.Text  = page.indicateString;
     txtNavigateUrl.Text     = page.navigateUrl;
     txtNavigateReferer.Text = page.navigateReferer;
     txtFormAction.Text      = page.ActionType;
 }
Exemplo n.º 4
0
 public void AddPage(LoginCore siteInfo, int index = -1)
 {
     if (index > -1)
     {
         pages.Insert(index, siteInfo);
         ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                           "Editted Page " + siteInfo.Name));
     }
     else
     {
         pages.Add(siteInfo);
         ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                           "Added new Page " + siteInfo.Name));
     }
 }
Exemplo n.º 5
0
        public void AddPage(LoginCore editingPage, string pageName, string postString,
                            string indicateString, string navigateUrl, string navigateReferer, string formAction)
        {
            LoginCore page = new LoginCore(ChangeUI, pageName, postString, indicateString,
                                           navigateUrl, navigateReferer, formAction);

            if (editingPage != null)
            {
                int index = core.pages.IndexOf(editingPage);
                core.pages.RemoveAt(index);
                core.AddPage(page, index);
            }
            else
            {
                core.AddPage(page);
            }
        }
Exemplo n.º 6
0
 public void SetCurrentPage(LoginCore loginCore)
 {
     page = loginCore;
     ChangeUI(this, new LoginEventArgs(EventType.Progress,
                                       "Set current Login Page as " + loginCore.Name));
 }