CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 19

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    8

    Posting data to a CGI script

    Dear all,

    I would like to know how to post data to a CGI script from a windows application. I've searched for answers days but couldn't find a right answer.

    If you go to the following webpage, it allows chemical structure searches. http://pubchem.ncbi.nlm.nih.gov/search/

    For example, if you enter C1=CC=CC=C1 to the 'Search SMILES and Formula' text box and click the 'Search' button,
    it will send data to
    http://pubchem.ncbi.nlm.nih.gov/search/PreQSrv.cgi

    I would like to implement this function directly onto my program.

    Would anyone please let me know
    1. how to post data to a CGI script?
    2. get the result back?

    Your kind help would greatly help me.
    Thank you so much in advance,

    Best,
    Mike

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Posting data to a CGI script

    You can do what you want with the CSocket class or the winsock control.

    Here's my post on how to use Winsock or the CSocket class to POST data to a web page:
    http://www.codeguru.com/forum/showth...013#post701796

    Let us know how it goes.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  3. #3
    Join Date
    Jan 2006
    Posts
    8

    Re: Posting data to a CGI script

    Thanks WizBang,

    I found out that I post my thread to a wrong forum. It should be in Visual Basic .Net not 6.0. I am sorry about that.

    Would you let me know how to do same thing in VB .NET if are aware of?

    Thank you and I will put this post .NET forum as well.

    Best,

    Mike

  4. #4
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Posting data to a CGI script

    [ Moved Thread ]
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  5. #5
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Posting data to a CGI script

    The data you send in the POST to the server will be the same no matter what language you are using, and I'm sure there are numerous threads showing how to use winsock or equivelent for it. If not, then Google will surely turn up something. Now that you have the format for the POST, the rest will be fairly simple I'm sure.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  6. #6
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Posting data to a CGI script

    Take a look at the WebClient class.

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

Featured