Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim wb As New Net.WebClient
- Dim url As String = "&url=" & Uri.EscapeDataString(TextBox1.Text)
- Dim rsp As String
- Try
- rsp = wb.DownloadString("https://is.gd/create.php?format=json" & url & "&shorturl=" & TextBox3.Text & "&logstats=1") 'خاصية أختيارية ليتمكن المستخدم من لرؤية احصائيات الرابط logstats يمكن جعل
- Catch ex As Exception
- MsgBox(ex.Message, vbCritical, "")
- Exit Sub
- End Try
- Dim urli As SByte = rsp.IndexOf("http")
- If urli < 0 Then
- Dim errcode As Byte = rsp.Substring(rsp.IndexOf(":") + 2, 1)
- If errcode = 1 Then
- MsgBox("أكتب الرابط بشكل صحيح")
- ElseIf errcode = 2 Then
- MsgBox("الرابط موجود مسبقا")
- ElseIf errcode = 3 Then
- MsgBox("تخطيت العدد المسموح حاول لاحقآ")
- Else
- MsgBox("خطا في الخدمة")
- End If
- Exit Sub
- Else
- rsp = rsp.Substring(urli, rsp.LastIndexOf("""") - urli)
- End If
- TextBox2.Text = rsp
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement