Click here to Skip to main content
15,891,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can i disable the One Page/Two Page button in the print preview window? Pin
Roger Allen16-Feb-05 1:58
Roger Allen16-Feb-05 1:58 
GeneralRe: Can i disable the One Page/Two Page button in the print preview window? Pin
AnoopVarma16-Feb-05 17:15
AnoopVarma16-Feb-05 17:15 
GeneralNagging Menu Check Problem Pin
LighthouseJ15-Feb-05 14:09
LighthouseJ15-Feb-05 14:09 
GeneralRe: Nagging Menu Check Problem Pin
Ravi Bhavnani15-Feb-05 14:44
professionalRavi Bhavnani15-Feb-05 14:44 
GeneralSteps to make a clickable area drawn by a user at run time Pin
joy00715-Feb-05 14:01
joy00715-Feb-05 14:01 
GeneralRe: Steps to make a clickable area drawn by a user at run time Pin
JWood15-Feb-05 14:56
JWood15-Feb-05 14:56 
GeneralRe: Steps to make a clickable area drawn by a user at run time Pin
Maximilien16-Feb-05 0:34
Maximilien16-Feb-05 0:34 
GeneralHelp Needed ASAP PLZ on downloading url content to file. Pin
A.Sal15-Feb-05 13:24
A.Sal15-Feb-05 13:24 
Hello everyone... Im new here, and kindda need some help please. Im trying to make a program in C code to download web page and store contents to a file. I have the socket creation and rule definition partfor Client done, but im not sure how to insert the get function, and about the syntax of the function.
<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
<br />
int main (int argc, char *argv[] )<br />
{<br />
int s, n;<br />
struct sockaddr_in sin; struct hostent *hptr;<br />
char msg[80] = "Hello World!";<br />
if ( argc < 3 ) {<br />
printf ("%s host port\n", argv[0] ); /* input error: need host & port */<br />
return -1;<br />
}<br />
if ( (s = socket(PF_INET, SOCK_STREAM, 0 ) ) < 0) { /* create socket*/<br />
perror("socket"); /* socket error */<br />
return -1;<br />
}<br />
sin.sin_family = PF_INET; /*set protocol family to Internet */<br />
sin.sin_port = htons(atoi(argv[2])); /* set port no. */<br />
if ( (hptr = gethostbyname(argv[1]) ) == NULL){<br />
fprintf(stderr, "gethostname error: %s", argv[1]);<br />
return -1;<br />
}<br />
memcpy( &sin.sin_addr, hptr->h_addr, hptr->h_length);<br />
if (connect (s, (struct sockaddr *)&sin, sizeof(sin) ) < 0 ){<br />
perror("connect"); return -1; /* connect error */<br />
}<br />
if ( write(s, msg, strlen(msg) +1) < 0 ) { /* send message to server */<br />
perror("write"); return -1; /* write error */<br />
}<br />
if ( ( n = read(s, msg, sizeof(msg) ) ) <0) { /* read message from server */<br />
perror("read"); return -1; /* read error */<br />
}<br />
printf (" %d bytes: %s\n", n, msg); /* print message to screen */<br />
/* close connection, clean up socket */<br />
if (close(s) < 0) {<br />
perror("close"); /* close error */<br />
return -1;<br />
}<br />
return 0;<br />
}<br />


I need the code for the request from the Client, and the response from the Server.
Please, help me ASAP... thanks to you in advance.
Please feel free to point out any errore in my code.
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
vinnzy15-Feb-05 13:43
vinnzy15-Feb-05 13:43 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
Ravi Bhavnani15-Feb-05 15:13
professionalRavi Bhavnani15-Feb-05 15:13 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
A.Sal16-Feb-05 0:17
A.Sal16-Feb-05 0:17 
Generalhelp with the operator overloading Pin
Flydian15-Feb-05 13:16
Flydian15-Feb-05 13:16 
GeneralRe: help with the operator overloading Pin
Bob Ciora16-Feb-05 1:34
Bob Ciora16-Feb-05 1:34 
Generalproblem returning arrays Pin
aaadetos15-Feb-05 13:05
aaadetos15-Feb-05 13:05 
GeneralRe: problem returning arrays Pin
John R. Shaw15-Feb-05 13:32
John R. Shaw15-Feb-05 13:32 
GeneralRe: problem returning arrays Pin
aaadetos15-Feb-05 16:12
aaadetos15-Feb-05 16:12 
GeneralRe: problem returning arrays Pin
$8816-Feb-05 20:30
$8816-Feb-05 20:30 
GeneralRe: problem returning arrays Pin
Branislav17-Feb-05 0:19
Branislav17-Feb-05 0:19 
GeneralRe: problem returning arrays Pin
aaadetos22-Feb-05 1:27
aaadetos22-Feb-05 1:27 
GeneralRe: problem returning arrays Pin
Branislav22-Feb-05 22:56
Branislav22-Feb-05 22:56 
GeneralRe: problem returning arrays Pin
$8816-Feb-05 0:14
$8816-Feb-05 0:14 
GeneralRe: problem returning arrays Pin
Anonymous22-Feb-05 1:23
Anonymous22-Feb-05 1:23 
GeneralRe: problem returning arrays Pin
$8822-Feb-05 2:17
$8822-Feb-05 2:17 
GeneralPrecompiled Headers Pin
JWood15-Feb-05 12:38
JWood15-Feb-05 12:38 
GeneralRe: Precompiled Headers Pin
Selvam R15-Feb-05 22:27
professionalSelvam R15-Feb-05 22:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.