programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
   Main Menu
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

   Amazon
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

   Links
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
Code examples are sponsored by Webmastersearn : make money with your website

 

Internet example

Connect to a site example

/*remember and add a reference to the wininet.lib
go to project / settings or ALT F7 , now go to the link tab
in the object / library modules box type in wininet.lib . click on OK
If you do not do this for linking you will be met with a number
of linker errors
*/
#include<windows.h>
#include<wininet.h>
#include<stdio.h>

int main()
{

HINTERNET Initialize,Connection,File;
DWORD dwBytes;
char ch;
/*initialize the wininet library*/
Initialize = InternetOpen("HTTPGET",INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
/*connect to the server*/
Connection = InternetConnect(Initialize,"www.yahoo.com",INTERNET_DEFAULT_HTTP_PORT,
NULL,NULL,INTERNET_SERVICE_HTTP,0,0);
/*open up an HTTP request*/
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);
}
}
/*close file , terminate server connection and
deinitialize the wininet library*/
InternetCloseHandle(File);
InternetCloseHandle(Connection);
InternetCloseHandle(Initialize);
return 0;
}



Clickbank mall, make money
sell software, make money
Hosted magazine site : make money with no website



 


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
Octal, hex and decimal(C++)
Wired news(PHP)
multi messages in the status bar(Javascript)
rectangular form example(VB)
Java version with php(PHP)
16 or 32 bit computer(ASP.net)
get the path of the favorites folder(VB.net)
Create a link(ASP.net)




Copyright © 2004 by programmershelp.co.uk