Advertisement
Guest User

Untitled

a guest
May 4th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.58 KB | None | 0 0
  1. Public Class frmMain
  2.     Dim WithEvents WB As New WebBrowser With {.ScriptErrorsSuppressed = True}
  3.     Dim WithEvents Timer1 As New Timer
  4.     Dim TheText As New TextBox
  5.  
  6.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  7.         ProgressBar1.Style = ProgressBarStyle.Blocks
  8.         WB.Navigate("https://privnote.com/")
  9.     End Sub
  10.  
  11.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  12.         TheText.Text = TextBox1.Text
  13.         WB.Document.GetElementById("note_raw").SetAttribute("value", TheText.Text)
  14.         WB.Document.GetElementById("encrypt_note").InvokeMember("click")
  15.         TextBox1.Enabled = False
  16.         Button1.Enabled = False
  17.         ProgressBar1.Style = ProgressBarStyle.Marquee
  18.         Timer1.Start()
  19.     End Sub
  20.  
  21.     Private Sub WB_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WB.DocumentCompleted
  22.  
  23.     End Sub
  24.  
  25.     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  26.         TextBox2.Text = WB.Document.GetElementById("note_link_input").GetAttribute("value")
  27.  
  28.         If TextBox2.Text = Nothing Then
  29.             WB.Document.GetElementById("note_raw").SetAttribute("value", TheText.Text)
  30.             WB.Document.GetElementById("encrypt_note").InvokeMember("click")
  31.         Else
  32.  
  33.             Button1.Enabled = True
  34.             TextBox1.Enabled = True
  35.             ProgressBar1.Hide()
  36.             TextBox1.Clear()
  37.             WB.Navigate("https://privnote.com/")
  38.             Timer1.Stop()
  39.         End If
  40.     End Sub
  41. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement