Exemplo n.º 1
0
        private void MaterialRaisedButton2_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrWhiteSpace(NEW.Text))
            {
                if (Base64C.IsValidUri(NEW.Text))
                {
                    if (Base64C.CheckReachableSite(NEW.Text))
                    {
                        WebClient x      = new WebClient();
                        string    source = x.DownloadString($"{NEW.Text}");
                        string    title  = Regex.Match(source, @"\<title\b[^>]*\>\s*(?<Title>[\s\S]*?)\</title\>",
                                                       RegexOptions.IgnoreCase).Groups["Title"].Value;

                        Site site = new Site(title, NEW.Text);
                        site.Show();
                    }
                    else
                    {
                        SystemSounds.Beep.Play();
                        MessageBox.Show("Site does not exist!");
                    }
                }
                else
                {
                    SystemSounds.Beep.Play();
                    MessageBox.Show("That is not a valid url!");
                }
            }
        }
Exemplo n.º 2
0
 private void Encode_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrWhiteSpace(OG.Text))
     {
         NEW.Text = Base64C.Encode(OG.Text);
         AddToHistory(OG.Text);
     }
 }
Exemplo n.º 3
0
 private void V_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrWhiteSpace(OG.Text))
     {
         if (Base64C.IsBase64String(OG.Text))
         {
             NEW.Text = Base64C.Decode(OG.Text);
             AddToHistory(NEW.Text);
         }
         else
         {
             MessageBox.Show("That is not a base64 string!");
         }
     }
 }
Exemplo n.º 4
0
 private void PEC_Click(object sender, EventArgs e)
 {
     //Paste, Encode, Copy
     if (!String.IsNullOrWhiteSpace(Clipboard.GetText()))
     {
         OG.Text  = Clipboard.GetText();
         NEW.Text = Base64C.Encode(Clipboard.GetText());
         Clipboard.SetText(NEW.Text);
         AddToHistory(NEW.Text);
     }
     else
     {
         SystemSounds.Hand.Play();
         MessageBox.Show("That is not some text!");
     }
 }
Exemplo n.º 5
0
 private void GetTitle_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex != -1)
     {
         if (Base64C.IsValidUri(listBox1.SelectedItem.ToString()))
         {
             WebClient x      = new WebClient();
             string    source = x.DownloadString(listBox1.SelectedItem.ToString());
             string    title  = Regex.Match(source, @"\<title\b[^>]*\>\s*(?<Title>[\s\S]*?)\</title\>",
                                            RegexOptions.IgnoreCase).Groups["Title"].Value;
             MessageBox.Show(title);
         }
         else
         {
             SystemSounds.Beep.Play();
             MessageBox.Show("That is not a valid url!");
         }
     }
 }