public async void GetUserID(string link)
        {
            this.Show();
            await Task.Delay(5000);

            try
            {
                foreach (HtmlElement he in ProcessBrowser.Document.All.GetElementsByName("fburl"))
                {
                    he.SetAttribute("value", link);
                }
                var elements = ProcessBrowser.Document.GetElementsByTagName("button");
                foreach (HtmlElement element in elements)
                {
                    if (element.InnerHtml.Contains("Find Facebook"))
                    {
                        element.InvokeMember("Click");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The operation failed. Go to LOG for more information.", "Exception");
                LogErrors.Excep(ex.GetType().FullName, ex.Message);
                this.Close();
            }
        }
 private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     if (!e.IsAvailable)
     {
         LogErrors.LogWrite(LogErrors.NoInternetConnection);
         Environment.Exit(0);
     }
 }
        public async void UnbanUsers(string groupID, string UserID)
        {
            this.Show();
            try
            {
                await Task.Delay(5000);

                HtmlElementCollection col = ProcessBrowser.Document.GetElementsByTagName("a");
                bool first = true;
                foreach (HtmlElement el in col)
                {
                    if (el.GetAttribute("href").Contains("remove_block"))
                    {
                        if (first)
                        {
                            el.SetAttribute("href", "/ajax/groups/admins_get.php/?group_id=" + groupID + "&user_id=" + UserID + "&action=remove_block&source=profilebrowser_blocked");
                            el.InvokeMember("Click");
                            await Task.Delay(2000);

                            foreach (HtmlElement he in ProcessBrowser.Document.All.GetElementsByName("remove_block"))
                            {
                                await Task.Delay(2000);

                                he.InvokeMember("Click");
                                first = false;
                                await Task.Delay(4000);
                            }
                            first = false;
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The user is already unbanned, or you dont have permission to perform this function.", ex.GetType().Name);
                LogErrors.Excep(ex.GetType().FullName, ex.Message);
            }
        }
示例#4
0
 private void WithoutInternetConnection_Load(object sender, EventArgs e)
 {
     LogErrors.LogWrite(LogErrors.NIC_OnStart);
 }