Results 1 to 14 of 14

Thread: Command line application help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    Command line application help

    ok i dont know much about c but i am trying to make an aplication that will exec this url without opening IE or some other browser.
    Code:
    https://www.ChangeIP.com/nic/update?hostname=<hostname>&myip=http://www.ChangeIP.com/ip.asp&u=<username>&p=<password>
    does anyone know how i can make this?

    i would like to be able to have these arguments..

    -h for hostname
    -u for username
    -p for password

    could you either recomend a site to look at or help me? thanks!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What do you mean exec?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    execute thats what i mean by exec

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    this is what i have so far...

    Code:
    int main(int argc, char* argv[])
    {
      int ich;
    
      while ((ich = (argc, argv, "abc"))) {
        switch (ich) {
          case 'a': /* Flags/Code when -a is specified */
            printf("test a");
            break;
          case 'b': /* Flags/Code when -b is specified */
                    /* The argument passed in with b is specified */
    		/* by optarg */
            printf("test b");
            break;
          case 'c': /* Flags/Code when -c is specified */
            printf("test c");
            break;
          default: /* Code when there are no parameters  */
            printf("test none");
            break;
        }
      }
        return 1;
    }
    and when i do that no matter what i do it says test none repeating over and over... can anyone help me fix taht then i can work on the http stuff?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What do you mean by executing URLs?

    Code:
    while ((ich = (argc, argv, "abc")))
    No way, what should this line do?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i dont know, im trying to figure out how to make an aplication that i can execute something like this "c:\folder\app -h host.dns.com -u username -p password" and it will update my dns.

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    But what do you mean by executing an URL?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i need to be able to send a http request though tcp in my program, like you do in telnet with "GET HTTP/1.0" i need to be able to send that through the command line program im making.

  9. #9
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Try Winsock Sockets. Do some research on MSDN
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    im using borland...so do you have any sujestions for that?

  11. #11
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    google is always a good start if you need to find info.
    here are some links

    http://tangentsoft.net/wskfaq/
    http://www.sockaddr.com/ExampleSourceCode.html
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    thanks for the links, i have been using google. for the past few days...with no luck ill tell ya how it turns out.

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Can't you simply write an input file for telnet?

    Code:
    telnet < input.txt
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i could but im trying to write a program to do the same thing. i want to learn how things are done.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width