Guest User

Untitled

a guest
Jul 15th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.40 KB | None | 0 0
  1. Imports System.Net
  2. Imports System.IO
  3. Imports System.Net.Sockets
  4. Imports System.Net.NetworkInformation
  5. Imports System.Net.HttpWebRequest
  6. Imports System
  7. Imports System.Globalization
  8. Imports System.Windows.Forms
  9. Imports AutoUpdaterDotNET
  10. Imports Microsoft.Win32
  11.  
  12.  
  13. Public Class Form1
  14.  
  15.     Dim game As New Process()
  16.  
  17. #Region "Check Server Status"
  18.  
  19.  
  20.  
  21.     Private Sub CheckServerStatus()
  22.         Dim tryconnect1 As New UdpClient
  23.  
  24.  
  25.         Try
  26.             tryconnect1.Connect("78.46.71.147", 7777)
  27.             Label2.ForeColor = Color.Lime
  28.             Label2.Text = "Online"
  29.         Catch ex As Exception
  30.             Label2.ForeColor = Color.Red
  31.             Label2.Text = "Offline"
  32.         End Try
  33.  
  34.     End Sub
  35. #End Region
  36.  
  37.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  38.         CheckServerStatus()
  39.     End Sub
  40.  
  41.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  42.         AutoUpdater.Start("http://fusion-host.org/breadfish/AppCast.xml")
  43.     End Sub
  44.  
  45.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  46.         If Label2.Text = "Online" Then
  47.             MsgBox("Du wirst nun zum Server verbunden ...")
  48.             Process.Start("samp://78.46.71.147:7777")
  49.         Else
  50.             MsgBox("Der Server ist zur Zet Offline !!!")
  51.         End If
  52.     End Sub
  53.  
  54. End Class
Advertisement
Add Comment
Please, Sign In to add comment