Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do create a class property that is a collection of the same class? Pin
Richard Deeming11-Feb-20 8:46
mveRichard Deeming11-Feb-20 8:46 
GeneralRe: How do create a class property that is a collection of the same class? Pin
Dave Kreskowiak11-Feb-20 9:02
mveDave Kreskowiak11-Feb-20 9:02 
GeneralRe: How do create a class property that is a collection of the same class? Pin
Member 1474182312-Feb-20 0:04
Member 1474182312-Feb-20 0:04 
GeneralRe: How do create a class property that is a collection of the same class? Pin
Richard Deeming12-Feb-20 0:15
mveRichard Deeming12-Feb-20 0:15 
AnswerRe: How do create a class property that is a collection of the same class? Pin
Gerry Schmitz11-Feb-20 14:14
mveGerry Schmitz11-Feb-20 14:14 
AnswerRe: How do create a class property that is a collection of the same class? Pin
Member 1474182312-Feb-20 0:51
Member 1474182312-Feb-20 0:51 
QuestionHow to Pass the textbox value into Textbox1 in Web Browser in WPF Pin
Hernany Bondoc11-Feb-20 6:27
Hernany Bondoc11-Feb-20 6:27 
Questioncontinuous PING application ? Pin
auting8210-Feb-20 9:27
auting8210-Feb-20 9:27 
Hi , I have here an ping application implemented as a console application.

I want to turn this into a continuous ping application. Can someone give me a tip how to change this code so it runs continuously.


C#
///////////////////////////////////////////////////////////////////////////////////////////
///
/// PingAppConsile: application testing the ping() connection to a node
///
/// Based on code form Microsoft MSDN about the ping() command
///
/// Version: 1.0: 8-JAN-17: NOS
///
///////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Net;
using System.Net.NetworkInformation;
//
namespace PingAppConsole
{
    class Program
    {
        /// <summary>
        /// //////////////////////////////////////////////////////////////////////////////
        static void Main(string[] args)
        ///
        /// Purpose: the main function in the application handling the ping()communication
        ///
        /// Version: 1.0: 09-FEB-20: Adis Pipic
        /// </summary>
        {
            string host, data;
            byte[] buffer;
            int timeout;
            Ping pingSender = new Ping();
            PingOptions options = new PingOptions();
            // Use the default Ttl value which is 128,
            // but change the fragmentation behavior.
            options.DontFragment = true;
            // Create a buffer of 32 bytes of data to be transmitted.
            data = "Rodham street";
            buffer = Encoding.ASCII.GetBytes(data);
            timeout = 120;
            // Name or address of node to access
            host = "www.google.no";
            PingReply reply = pingSender.Send(host, timeout, buffer, options);
            if (reply.Status == IPStatus.Success)
            {
                Console.WriteLine(" Ping communication status for {0}:", host);
                Console.WriteLine(" ------------------------------------------");
                Console.WriteLine(" Address: {0}", reply.Address.ToString());
                Console.WriteLine(" RoundTrip time (mSec): {0}", reply.RoundtripTime);
                Console.WriteLine(" Time to live: {0}", reply.Options.Ttl);
                Console.WriteLine(" Dont fragment: {0}", reply.Options.DontFragment);
                Console.WriteLine(" Buffer size: {0}", reply.Buffer.Length);
                Console.WriteLine(" ------------------------------------------");
            }
            else
            {
                Console.WriteLine(" Error connecting to network address/name {0}", host);
            }
            Console.WriteLine(" Press CR or Enter to Quit the application");
            Console.ReadLine();
        }
    }
}

AnswerRe: continuous PING application ? Pin
k505410-Feb-20 10:48
mvek505410-Feb-20 10:48 
GeneralRe: continuous PING application ? Pin
auting8211-Feb-20 9:31
auting8211-Feb-20 9:31 
GeneralRe: continuous PING application ? Pin
k505411-Feb-20 10:27
mvek505411-Feb-20 10:27 
GeneralRe: continuous PING application ? Pin
auting8211-Feb-20 10:48
auting8211-Feb-20 10:48 
AnswerRe: continuous PING application ? Pin
Gerry Schmitz10-Feb-20 13:56
mveGerry Schmitz10-Feb-20 13:56 
QuestionModifying multiple fields based on a condition Pin
Bice908-Feb-20 1:07
Bice908-Feb-20 1:07 
AnswerRe: Modifying multiple fields based on a condition Pin
Richard MacCutchan8-Feb-20 1:41
mveRichard MacCutchan8-Feb-20 1:41 
GeneralRe: Modifying multiple fields based on a condition Pin
Bice908-Feb-20 4:10
Bice908-Feb-20 4:10 
GeneralRe: Modifying multiple fields based on a condition Pin
jsc4210-Feb-20 4:09
professionaljsc4210-Feb-20 4:09 
GeneralRe: Modifying multiple fields based on a condition Pin
Richard MacCutchan10-Feb-20 5:11
mveRichard MacCutchan10-Feb-20 5:11 
AnswerRe: Modifying multiple fields based on a condition Pin
OriginalGriff8-Feb-20 2:49
mveOriginalGriff8-Feb-20 2:49 
GeneralRe: Modifying multiple fields based on a condition Pin
Bice908-Feb-20 4:12
Bice908-Feb-20 4:12 
AnswerRe: Modifying multiple fields based on a condition Pin
Eddy Vluggen8-Feb-20 2:51
professionalEddy Vluggen8-Feb-20 2:51 
GeneralRe: Modifying multiple fields based on a condition Pin
Bice908-Feb-20 4:15
Bice908-Feb-20 4:15 
AnswerRe: Modifying multiple fields based on a condition Pin
phil.o8-Feb-20 3:04
professionalphil.o8-Feb-20 3:04 
GeneralRe: Modifying multiple fields based on a condition Pin
Bice908-Feb-20 4:17
Bice908-Feb-20 4:17 
GeneralRe: Modifying multiple fields based on a condition Pin
phil.o8-Feb-20 4:53
professionalphil.o8-Feb-20 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.