Page 1 of 1

How do I ping classic servers?

PostPosted: 18 Dec 2013, 20:47
by Leeizazombie
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?

Re: How do I ping classic servers?

PostPosted: 18 Jan 2014, 14:27
by joppiesaus
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>