How do I ping classic servers?

How do I ping classic servers?

Postby Leeizazombie » 18 Dec 2013, 20:47

I know how to find out the IP and Port of a server and I want to use mine in a program to determine whether it's online or offline. This is one of my attempts:
Code: Select all
private void button1_Click(object sender, EventArgs e)
        {
            WebClient webClient = new WebClient();
            try
            {
                byte[] result = webClient.DownloadData(URLtext.Text);
                label1.Text = "Online";
            }
            catch
            {
                label1.Text = "Offline";
            }
        }

My other attempt was using a thing like:
Code: Select all
var ping = new System.Net.NetworkInformation.Ping();

var result = ping.Send("www.google.com");

if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
    return;

But when I enter an IP:Port it will always show offline!.. How do I make this work?
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: How do I ping classic servers?

Postby joppiesaus » 18 Jan 2014, 14:27

I think the first won't work because a MCDzienny server doesn't allow that, and the second one... I have no idea. I think Dzienny will now an alternate mode. <ok>
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron