Results 1 to 5 of 5
  1. #1
    Kallisti's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,019
    Reputation
    52
    Thanks
    376
    My Mood
    In Love

    Console Pinging program

    Alright lets do this
    Im trying to make a simple C++ console program that, with the website name given in a string, it pings it. Heres my code sofar but i dont know how to make it ping the entered string

    Is it even possible?

    [php]#include <iostream>
    #include <string>

    using namespace std;
    int main()
    {
    string website;
    cout << "Enter the website you want to ping\n";
    cin >> website;
    system("ping ");

    return 0;
    }

    [/php]

    未来が見えなくて怖いから
    未来が見えてしまって悲しいから
    目を閉じて優しい思い出に浸ってしまう




  2. #2
    faceofdevil's Avatar
    Join Date
    Jul 2009
    Gender
    female
    Posts
    77
    Reputation
    9
    Thanks
    6
    Without going into to much detail. I would suggest that you use this to ping a website.
    Of course you would have to build a client side connection to ping it.

    Code:
    https://support.microsof*****m/default.aspx?scid=kb;en-us;170591

  3. #3
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical
    hmm idk how to make a ping sender in C++
    but i found some VB tuts for that :/
    u can search them on youtube

    CANNIBAL CORPSE P0WNS


  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Code:
    char tcmd[128];
    sprintf_s(tcmd, 128, "ping %s", ip);
    system(tcmd);
    Ah we-a blaze the fyah, make it bun dem!

  5. The Following User Says Thank You to Hell_Demon For This Useful Post:

    Kallisti (08-02-2010)

  6. #5
    faceofdevil's Avatar
    Join Date
    Jul 2009
    Gender
    female
    Posts
    77
    Reputation
    9
    Thanks
    6
    No credits to me but this should work. Also can use the commandline to ping as well.

    C:>ping xxx.xxx.xxx.xxx.

    C:>exit

    Code:
    #include <iostream>
    #include <string>
    #include <windows.h>
    
    using namespace std;
    
    static string host;
    static string ping_again;
    
    void ping()
    {
         system("cls");
         cout << "Host: ";
         cin >> host;
         system (("ping " + host).c_str());
         cout << endl;
         cout << "(Y)es or (N)o\n\n";
         cout << "Ping another host: ";
         cin >> ping_again;
         if (ping_again == "Y" || ping_again == "y")
         {
         system("cls");
         ping();
         }
         else if (ping_again == "N" || ping_again == "n")
         {
         system("exit");
         }
    }
    
    int main()
    {
         SetConsoleTitle("Ping in C++ ");
         ping();
    
         return(0);
    }

  7. The Following User Says Thank You to faceofdevil For This Useful Post:

    Kallisti (08-02-2010)

Similar Threads

  1. good program ping
    By grypery in forum CrossFire Discussions
    Replies: 25
    Last Post: 04-12-2011, 03:36 PM
  2. a good java program
    By snipelock in forum Java
    Replies: 18
    Last Post: 04-17-2009, 02:56 PM
  3. Runescape 2 auto programs
    By fabled in forum Hack Requests
    Replies: 19
    Last Post: 09-05-2007, 01:43 PM
  4. Problem Wit Hacking Programs
    By f5awp in forum General Gaming
    Replies: 5
    Last Post: 01-10-2006, 05:44 AM
  5. Matrix Ping Pong
    By gunot in forum General
    Replies: 4
    Last Post: 01-04-2006, 01:25 AM