Imports System.Net
Imports System.IO
Public Class Form1
Private Sub ReactorButton1_Click(sender As Object, e As EventArgs) Handles ReactorButton1.Click
'checking the network availability
If My.Computer.Network.IsAvailable Then
'creating the webrequest point
Dim Request As WebRequest = DirectCast(WebRequest.Create(Setting.ReactorTextBox1.Text + ReactorTextBox1.Text), HttpWebRequest)
'defining the response
Dim Response As HttpWebResponse = DirectCast(Request.GetResponse, HttpWebResponse)
'getting the response
Dim Stream As New StreamReader(Response.GetResponseStream)
'writing the response(shortened URL)
Dim ShortURL As String = Stream.ReadToEnd
ReactorTextBox2.Text = ShortURL
Else
MsgBox("Please Connect To The Internet And Try Again", MsgBoxStyle.Critical)
End If
End Sub
Private Sub ReactorButton3_Click(sender As Object, e As EventArgs) Handles ReactorButton3.Click
'copying...
Clipboard.SetText(ReactorTextBox2.Text)
MsgBox("Sucessfully Copied To Clipboard")
End Sub
Private Sub ReactorButton2_Click(sender As Object, e As EventArgs) Handles ReactorButton2.Click
Setting.Show()
End Sub
Private Sub ReactorTheme1_Click(sender As Object, e As EventArgs) Handles ReactorTheme1.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
If Setting.ReactorTextBox1.Text = "" Then
Setting.Show()
ReactorButton1.Enabled = False
MsgBox("Insert your Api code please")
Else
ReactorButton1.Enabled = True
End If
End Sub
End Class