Advertisement
Guest User

Launcher

a guest
Nov 27th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. Imports System.Net
  2. Imports MySql.Data.MySqlClient
  3.  
  4. Public Class Form1
  5. Dim SQL_HOST As String = ""
  6. Dim SQL_USER As String = ""
  7. Dim SQL_PASSWORD As String = ""
  8. Dim SQL_DB As String = ""
  9.  
  10. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  11. Process.Start("samp://IP:PORT")
  12. End Sub
  13.  
  14. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  15. Process.Start("http://deine_seite.de")
  16. End Sub
  17.  
  18. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  19. Process.Start("https://www.facebook.com//")
  20. End Sub
  21.  
  22. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  23. Process.Start("ts3server://IP")
  24. End Sub
  25.  
  26. Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  27. Process.Start("http://deine_seite.de/")
  28. End Sub
  29.  
  30. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  31. Process.Start("http://youtube.com/")
  32. End Sub
  33.  
  34. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  35. Dim client As WebClient = New WebClient()
  36. client.Proxy = Nothing
  37. Try
  38. RichTextBox1.Text = client.DownloadString("http://deine_seite.de/news.txt")
  39. Catch ex As Exception
  40. RichTextBox1.Text = vbNewLine & "Error."
  41. End Try
  42.  
  43. aktualizuj()
  44.  
  45. Try
  46. Dim version As String = client.DownloadString("http://deine_seite.de/version.txt")
  47. If Not (version = Application.ProductVersion) Then
  48. MessageBox.Show("Es gibt eine neue Version." & vbNewLine & "Besuche http://deine_seite.de/ um zu Downloadeen." & vbNewLine & "Es wird empfohlen die neuste Version zu benutzen", "Es gibt eine Aktualissierung", MessageBoxButtons.OK, MessageBoxIcon.Information)
  49. End If
  50. Catch ex As Exception
  51. MessageBox.Show("Error bei dem Download. Melde dich bei einem Administratoren", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error)
  52. End Try
  53. End Sub
  54.  
  55. Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  56. aktualizuj()
  57. End Sub
  58. Private Sub aktualizuj()
  59. Dim MysqlConn As MySqlConnection
  60. Dim data As MySqlDataReader
  61. Dim adapter As New MySqlDataAdapter
  62. Dim command As New MySqlCommand
  63. Dim gracze As Integer = 0
  64. Dim admini As Integer = 0
  65.  
  66. MysqlConn = New MySqlConnection()
  67. MysqlConn.ConnectionString = "server=" & SQL_HOST & ";" & "user id=" & SQL_USER & ";" & "password=" & SQL_PASSWORD & ";" & "database=" & SQL_DB
  68.  
  69. Try
  70. MysqlConn.Open()
  71. Catch ex As Exception
  72. Label1.Text = "ERROR keine Verbindung melde dich bei einem Administratoren!"
  73. End Try
  74.  
  75. Try
  76. command.CommandText = "SELECT anzahl FROM online WHERE typ='spieler'"
  77. command.Connection = MysqlConn
  78. adapter.SelectCommand = command
  79. data = command.ExecuteReader
  80. While data.Read()
  81. spieler = data(0).ToString
  82. End While
  83. data.Close()
  84.  
  85. command.CommandText = "SELECT anzahl FROM online WHERE typ='admins'"
  86. command.Connection = MysqlConn
  87. adapter.SelectCommand = command
  88. data = command.ExecuteReader
  89. While data.Read()
  90. admins = data(0).ToString
  91. End While
  92. data.Close()
  93. Catch ex As Exception
  94. Label1.Text = "ERROR keine Verbindung, melde dich bei einem Administratoren."
  95. End Try
  96.  
  97. Label1.Text = "Spieler online: " & spieler & " (davon " & admins & " administratoren)"
  98. End Sub
  99. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement