Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Getting response from aspx page

Getting response from aspx page

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pryabu
    wrote on last edited by
    #1

    Hi, I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++. CInternetSession objInetSession; char szURL[100]; CStdioFile* objStdFile; try { wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx"); objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0); } catch(CInternetException* exp) { exp->ReportError(MB_OK,0); } Thanks,

    E D 2 Replies Last reply
    0
    • P Pryabu

      Hi, I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++. CInternetSession objInetSession; char szURL[100]; CStdioFile* objStdFile; try { wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx"); objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0); } catch(CInternetException* exp) { exp->ReportError(MB_OK,0); } Thanks,

      E Offline
      E Offline
      eusto
      wrote on last edited by
      #2

      use CHTTPFile and CHTTPConnection.

      1 Reply Last reply
      0
      • P Pryabu

        Hi, I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++. CInternetSession objInetSession; char szURL[100]; CStdioFile* objStdFile; try { wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx"); objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0); } catch(CInternetException* exp) { exp->ReportError(MB_OK,0); } Thanks,

        D Offline
        D Offline
        daveyerwin
        wrote on last edited by
        #3

        Hello, I use this code. It's only a little different and it should answer your Question.

        CInternetSession objInetSession;
        CHttpFile *pHttpFile;
        CString tmpStr;
        char inBuf[10000];
        UINT nBytesRead;
        try
        {
        pHttpFile =(CHttpFile *) objInetSession.OpenURL(
        CString("http://localhost"),
        1,
        INTERNET_FLAG_TRANSFER_ASCII,
        NULL,
        0
        );
        }
        catch(CInternetException* exp)
        {
        AfxMessageBox((LPCTSTR)"Some thing went astay",0,0);
        }
        nBytesRead = pHttpFile->Read(inBuf, sizeof(inBuf));
        AfxMessageBox(CString(inBuf,nBytesRead));
        }
        return nRetCode;

        P 1 Reply Last reply
        0
        • D daveyerwin

          Hello, I use this code. It's only a little different and it should answer your Question.

          CInternetSession objInetSession;
          CHttpFile *pHttpFile;
          CString tmpStr;
          char inBuf[10000];
          UINT nBytesRead;
          try
          {
          pHttpFile =(CHttpFile *) objInetSession.OpenURL(
          CString("http://localhost"),
          1,
          INTERNET_FLAG_TRANSFER_ASCII,
          NULL,
          0
          );
          }
          catch(CInternetException* exp)
          {
          AfxMessageBox((LPCTSTR)"Some thing went astay",0,0);
          }
          nBytesRead = pHttpFile->Read(inBuf, sizeof(inBuf));
          AfxMessageBox(CString(inBuf,nBytesRead));
          }
          return nRetCode;

          P Offline
          P Offline
          Pryabu
          wrote on last edited by
          #4

          thanks a lot

          D 1 Reply Last reply
          0
          • P Pryabu

            thanks a lot

            D Offline
            D Offline
            daveyerwin
            wrote on last edited by
            #5

            Well, you'r entirely welcome. I am most happy to edify.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups