Raised This Month: $ Target: $400
 0% 

PHP to VB


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-17-2015 , 18:28   Re: PHP to VB
Reply With Quote #2

Maybe something like this:
PHP Code:
Dim udpClient As New UdpClient(27015)
udpClient.Connect("127.0.0.1"27015);

Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(Chr(255) + Chr(255) + Chr(255) + Chr(255) + "TSource Engine Query")
udpClient.Send(sendBytessendBytes.Length)

Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any0)

udpClient.ReceiveTimeout 5

Dim receiveBytes 
As [Byte]() = udpClient.Receive(RemoteIpEndPoint)
Dim returnData As String Encoding.ASCII.GetString(receiveBytes)

If 
returnData.ToString() = "" Then
    Console
.WriteLine("Server offline")
Else
    
Console.WriteLine("Server online")
EndIf

udpClient.Close() 
I did not test it... it may have some silly sintax errors because I did not use vb.NET IDE and I have not been using it for a long time.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode