[C#]Ping Problem

12/13/2012 18:57 wunderdie#1
Guten Abend
Ich habe da mal eine frage und zwar
Ich möchte gerne eine Proxy checker schreibne und wollte es nicht über Httpwebrequest oder webproxy machen sondern per Ping

Jedoch kann ich nicht mit einem Port arbeiten:(

Code:
        public string proxyip(int index)
        {
            return Proxyview.Items[index].SubItems[0].Text.ToString() + ":" + Proxyview.Items[index].SubItems[1].Text.ToString();//
        }


public void Proxychecken(object Index)
        {
            while (isruning)
            {
                proyzahl++;
                if (proyzahl == Proxyview.Items.Count)
                {
                    isruning = false;
                    proyzahl = 1;
                    MessageBox.Show("Fetig");
                }
                string aIP = "";
                if (Proxyview.InvokeRequired)
                {
                    try
                    {
                        aIP = Proxyview.Invoke(new Proxydatenbekommen(proxyip), proyzahl).ToString();
                        Ping pingSender = new Ping();
                        PingOptions options = new PingOptions();
                        options.DontFragment = true;
                        string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
                        byte[] buffer = Encoding.ASCII.GetBytes(data);
                        int timeout = 120;
                        PingReply reply = pingSender.Send(aIP, timeout, buffer, options);
                        if (reply.Status == IPStatus.Success)
                        {
                            MessageBox.Show("Complete");
                        }
                    }
                    catch
                    {
                    }
                }
                else
                {
                    isruning = false;
                }
            }
        }

wie kann ich den Port hinzufügen?

Wäre sehr dankbar für hilfe
12/14/2012 10:26 tolio#2
da der werte herr zu faul zum selber googlen ist, das sollte deine frage beantworten:

Quote:
You cannot ping a port but you can try to connect to a specific port using either TCP/IP or UDP. The port concept belongs to the transport layer of the protocol stack (either TCP or UDP) while the ping is at the lower network layer (the ICMP protocol).
Quelle: [Only registered and activated users can see links. Click Here To Register...]

1. Google Suchergebniss für ".net ping specific port"
12/14/2012 16:34 wunderdie#3
oh das wusste ich garnicht:(
naja aber danke