lukelukeluke
Technical User
Hi there.
I begun with C++ a few days ago.
I found/modified this script to open a file on the computer. It works very fine, actually, it opens the file "test.txt" and displays its content into the commandline.
But what i wanted to do was displaying a content of a file located on my website. I got a file on my website ( displaying the remote (your) ip adress. I wanted to create an application which shows the content of this ip file into the commandline.
Thanks alot for your help!
Here is my source code:
any ideas of how to show the file on the web?
Thanks alot, help is very appreciated!
Webmaster of knowledgebase for IT knowledge.
I begun with C++ a few days ago.
I found/modified this script to open a file on the computer. It works very fine, actually, it opens the file "test.txt" and displays its content into the commandline.
But what i wanted to do was displaying a content of a file located on my website. I got a file on my website ( displaying the remote (your) ip adress. I wanted to create an application which shows the content of this ip file into the commandline.
Thanks alot for your help!
Here is my source code:
Code:
#include <stdio.h>
int main()
{
FILE * pFile;
char string [100];
[aqua]//[URL unfurl="true"]http://www.lookass.ch/src/clientip.php[/URL][/aqua]
[aqua]//test.txt[/aqua]
pFile = fopen ("[navy]test.txt[/navy]" , "r");
if (pFile == NULL) perror ("Error opening file");
else {
fgets (string , 100 , pFile);
puts (string);
fclose (pFile);
}
[aqua]//system("PAUSE");[/aqua]
return 0;
}
any ideas of how to show the file on the web?
Thanks alot, help is very appreciated!
Webmaster of knowledgebase for IT knowledge.