Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports MySql.Data.MySqlClient
- Public Class Form1
- Dim SQL_HOST As String = ""
- Dim SQL_USER As String = ""
- Dim SQL_PASSWORD As String = ""
- Dim SQL_DB As String = ""
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Process.Start("samp://IP:PORT")
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Process.Start("http://deine_seite.de")
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- Process.Start("https://www.facebook.com//")
- End Sub
- Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
- Process.Start("ts3server://IP")
- End Sub
- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
- Process.Start("http://deine_seite.de/")
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- Process.Start("http://youtube.com/")
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Dim client As WebClient = New WebClient()
- client.Proxy = Nothing
- Try
- RichTextBox1.Text = client.DownloadString("http://deine_seite.de/news.txt")
- Catch ex As Exception
- RichTextBox1.Text = vbNewLine & "Error."
- End Try
- aktualizuj()
- Try
- Dim version As String = client.DownloadString("http://deine_seite.de/version.txt")
- If Not (version = Application.ProductVersion) Then
- 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)
- End If
- Catch ex As Exception
- MessageBox.Show("Error bei dem Download. Melde dich bei einem Administratoren", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- aktualizuj()
- End Sub
- Private Sub aktualizuj()
- Dim MysqlConn As MySqlConnection
- Dim data As MySqlDataReader
- Dim adapter As New MySqlDataAdapter
- Dim command As New MySqlCommand
- Dim gracze As Integer = 0
- Dim admini As Integer = 0
- MysqlConn = New MySqlConnection()
- MysqlConn.ConnectionString = "server=" & SQL_HOST & ";" & "user id=" & SQL_USER & ";" & "password=" & SQL_PASSWORD & ";" & "database=" & SQL_DB
- Try
- MysqlConn.Open()
- Catch ex As Exception
- Label1.Text = "ERROR keine Verbindung melde dich bei einem Administratoren!"
- End Try
- Try
- command.CommandText = "SELECT anzahl FROM online WHERE typ='spieler'"
- command.Connection = MysqlConn
- adapter.SelectCommand = command
- data = command.ExecuteReader
- While data.Read()
- spieler = data(0).ToString
- End While
- data.Close()
- command.CommandText = "SELECT anzahl FROM online WHERE typ='admins'"
- command.Connection = MysqlConn
- adapter.SelectCommand = command
- data = command.ExecuteReader
- While data.Read()
- admins = data(0).ToString
- End While
- data.Close()
- Catch ex As Exception
- Label1.Text = "ERROR keine Verbindung, melde dich bei einem Administratoren."
- End Try
- Label1.Text = "Spieler online: " & spieler & " (davon " & admins & " administratoren)"
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement