Profit's Url Shortener


SUBMITTED BY: Guest

DATE: Sept. 15, 2013, 2:39 a.m.

FORMAT: Text only

SIZE: 1.9 kB

HITS: 1501

  1. Imports System.Net
  2. Imports System.IO
  3. Public Class Form1
  4. Private Sub ReactorButton1_Click(sender As Object, e As EventArgs) Handles ReactorButton1.Click
  5. 'checking the network availability
  6. If My.Computer.Network.IsAvailable Then
  7. 'creating the webrequest point
  8. Dim Request As WebRequest = DirectCast(WebRequest.Create(Setting.ReactorTextBox1.Text + ReactorTextBox1.Text), HttpWebRequest)
  9. 'defining the response
  10. Dim Response As HttpWebResponse = DirectCast(Request.GetResponse, HttpWebResponse)
  11. 'getting the response
  12. Dim Stream As New StreamReader(Response.GetResponseStream)
  13. 'writing the response(shortened URL)
  14. Dim ShortURL As String = Stream.ReadToEnd
  15. ReactorTextBox2.Text = ShortURL
  16. Else
  17. MsgBox("Please Connect To The Internet And Try Again", MsgBoxStyle.Critical)
  18. End If
  19. End Sub
  20. Private Sub ReactorButton3_Click(sender As Object, e As EventArgs) Handles ReactorButton3.Click
  21. 'copying...
  22. Clipboard.SetText(ReactorTextBox2.Text)
  23. MsgBox("Sucessfully Copied To Clipboard")
  24. End Sub
  25. Private Sub ReactorButton2_Click(sender As Object, e As EventArgs) Handles ReactorButton2.Click
  26. Setting.Show()
  27. End Sub
  28. Private Sub ReactorTheme1_Click(sender As Object, e As EventArgs) Handles ReactorTheme1.Click
  29. End Sub
  30. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
  31. If Setting.ReactorTextBox1.Text = "" Then
  32. Setting.Show()
  33. ReactorButton1.Enabled = False
  34. MsgBox("Insert your Api code please")
  35. Else
  36. ReactorButton1.Enabled = True
  37. End If
  38. End Sub
  39. End Class

comments powered by Disqus