ProAnswers.org

how can i connect to a website through c program .....

can u say which header files and things to use and where can i get that stuff…

you can use following header files.

#include
#include

i hope following code will clear your doubt.

/Connect to a site example/

#include
#include
#include
int main()
{

HINTERNET Initialize,Connection,File;
DWORD dwBytes;
char ch;
Connection = InternetConnect(Initialize,“www.xxx.com”,INTERNET_DEFAULT_HTTP_PORT,
NULL,NULL,INTERNET_SERVICE_HTTP,0,0);

File = HttpOpenRequest(Connection,NULL,"/index.html",NULL,NULL,NULL,0,0);

if(HttpSendRequest(File,NULL,0,NULL,0))
{
while(InternetReadFile(File,&ch,1,&dwBytes))
{
if(dwBytes != 1)break;
putchar(ch);
}
}
InternetCloseHandle(File);
InternetCloseHandle(Connection);
InternetCloseHandle(Initialize);
return 0;
}

look this also

http://souptonuts.sourceforge.net/code/http_post.c.html

#include

#include

http://www.zmi.li/46