Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where to start learning about internet communication in MFC programs

Status
Not open for further replies.

nbgoku

Programmer
May 25, 2004
108
0
0
US
where can i learn about how the program can communicate on the internet? is there are good tutorials out there that show how the interent works with C++?

my main goals is really just to check if a certain url exist, and if it does, a MessageBox("exist") should appear, but i need to figure out how to detect a website (SERVER/IP im guessing) and see if the file exist on that server
 
Check out the CInternetSession class and you'll be sure to find your answers;


Code:
[green]//Example?[/green]
[blue]
CStdioFile *myFile;
CInternetSession mySession;

myFile = mySession.GetURL("[URL unfurl="true"]http://www.tek-tips.com");[/URL]
[green]Opens Address file into file pointer[/green]
if (!myFile) { MessageBox("File not Found!"); }


[green]Run a loop to read the file in line by line[/green]
CString Data = NULL;
     while(myFile->ReadString(Data))
     {
     MessageBox("Line Data: "+Data);
     }
[/blue]

Just off the top of my head...
Hope that helps,
Ron

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
WOW!

had to change GetURL to OpenURL

but still it works!!
many thanks!
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top