VB.NET - Code Posted PasteBin !

Chào các bạn hôm nay mình xin giới thiệu cho các bạn biết một ứng dụng mới của mình :D, đó là posted PASTEBIN một trang cất giử dữ liệu của các HACKER và các CODER khá tốt hiện nay :P


Nhìn sơ hình ảnh trên các bạn cũng đã biết làm gì rồi chứ (đối với các coder) :D đó là thêm "2 TEXTBOX và 1 BUTTON " và điều còn lại là trang trí cho đẹp ứng dụng của các bạn thôi :D.


Còn bên dưới là FULL CODE cho mọi người nhé :D

Imports System.Collections.Specialized
Imports System.Net
Imports System.Text
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim webclient As New Net.WebClient
ToolStripStatusLabel4.Text = webclient.DownloadString("http://bomkhung.info/version-rss.txt")
TextBox3.Text = webclient.DownloadString("http://bomkhung.info/ban-quyen.txt")
Timer1.Enabled = webclient.DownloadString("http://bomkhung.info/time.txt")
ToolStripStatusLabel2.Text = TimeOfDay.TimeOfDay.ToString
Label1.Text = " Cảm Ơn Các Bạn Đã Sữ Dụng Ứng Dụng Của Bờm Khùng Blogger"
Process.Start("http://www.bomkhung.info")
End Sub
Public Class Paste
Dim _devkey As String
Dim _username As String
Dim _userpassword As String
Dim _PasteCode As String
Dim _PasteName As String
Dim _Syntax As String
Dim _ExpireDate As String
Dim _PasteExposure As Integer
Dim ukey As String
Sub New(ByVal Key As String, ByVal username As String, ByVal password As String, ByVal PasteCode As String, _
ByVal PasteName As String, ByVal PasteExposure As Integer, ByVal SyntaxHighlighting As String, _
ByVal ExpireDate As String)
_devkey = Key
_username = username
_userpassword = password
_PasteCode = PasteCode
_PasteName = PasteName
_PasteExposure = PasteExposure
_Syntax = SyntaxHighlighting
_ExpireDate = ExpireDate
End Sub

Public Function Start() As String
Dim chiavi As New NameValueCollection()
chiavi.Add("api_dev_key", _devkey)
chiavi.Add("api_user_name", _username)
chiavi.Add("api_user_password", _userpassword)

Dim wClient As New WebClient()
Dim risposta As String = Encoding.UTF8.GetString(wClient.UploadValues("http://pastebin.com/api/api_login.php", chiavi))

If risposta.ToLower.Contains("bad api request") Then
MessageBox.Show("Login failed!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return "ERROR"
Else
ukey = risposta
Try
Dim output As String = MakePaste() 'Restituisce una stringa
Process.Start(output)
Return "SUCCESS"
Catch Ex As Exception
MessageBox.Show("Exception: " & Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return "ERROR"
End Try
End If
End Function

Public Function MakePaste() As String
If ukey = "" Then Return "ERROR"

Dim chiavi As New NameValueCollection()
chiavi.Add("api_dev_key", _devkey)
chiavi.Add("api_user_key", ukey)
chiavi.Add("api_option", "paste")
chiavi.Add("api_paste_code", _PasteCode)
chiavi.Add("api_paste_name", _PasteName)
chiavi.Add("api_paste_format", _Syntax)
chiavi.Add("api_paste_private", _PasteExposure)
chiavi.Add("api_paste_expire_date", "N")

Dim wc As New WebClient()
Dim Risultato As String = ""
Dim Risposta As String = Encoding.UTF8.GetString(wc.UploadValues( _
"http://pastebin.com/api/api_post.php", chiavi))

If Risposta.ToLower.Contains("Sai Thông Tin API") Then
' Key non valida
Else
Risultato = Risposta
End If
Return Risultato
End Function


End Class

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Maker As New Paste("API Key", "User", "Password", TextBox1.Text, _
TextBox2.Text, 1, "Text", "N")
' Parameter ExpireDate> N= Never // 1M= 1 Month // 10M= 10 Minutes e così via, etc...
' Parameter PasteExposure> 0= Public // 1= Unlisted // 2= Private
ToolStripStatusLabel1.Text = "Login BOMKHUNG92 Successfull |"
GroupBox1.Text = TextBox2.Text
Maker.Start()
End Sub

Private Sub mainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
NotifyIcon1.Visible = True
Me.Visible = False
End If
End Sub

Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Visible = True
NotifyIcon1.BalloonTipText = "Bạn Đã Ẩn Ứng Dụng Xuống Dưới!"
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
NotifyIcon1.Visible = False
End If
End Sub


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' chử trên textbox chạy
Dim c1, c2 As String
c1 = TextBox3.Text.Substring(TextBox3.Text.Length - 1, 1)
c2 = TextBox3.Text.Substring(0, TextBox3.Text.Length - 1)
TextBox3.Text = c1 & c2
End Sub
End Class

Nhược điểm của đoạn code trên là mình chưa tìm ra cách tạo ra list nhưng code trong đó như "PHP,HTML"C#..." nên các bạn thông cảm cho mình nhé !

DOWNLOAD
Lê Hùng

Chia sẽ kiến thức và tư duy sáng tạo của bản thân mỗi ngày cho cộng đồng IT Việt Nam và Thế giới. Chia sẽ thủ thuật lập trình Csharp, Visual Basic, Python, Php, Javascript, Css, Html. Tối ưu hóa Windows, Microsoft, Facebook, Youtube, Chrome...v.v. Và nhiều thứ bổ trợ cho công nghệ lập trình mới nhất.

Đăng nhận xét

Mới hơn Cũ hơn
/* bao tri */