From: Per W. <pw...@ia...> - 2010-11-18 22:04:07
|
It's quite easy to implement a trivial web server supporting http 1.0. Just a TCP listener, that waits for a connect. When it receives the connect, retrieve the received data. It should contain one or more text lines, followed by two newline characters. If you get a "GET" request, you know a web browser wants to get a web page from your server. The path specified after GET tells what page that is requested - but for a really stupid server you can ignore that and always send the same page back. What you then need to send back is: --- HTTP/1.0 200 OK\n Server: <your_fancy_server>\n Content-Length: <number of bytes of HTML data>\n Connection: close\n Content-Type: text/html; charset-iso-8859-1\n \n <your html page here> --- Then close the connection and wait for more connects. The HTML part could be: ----- <!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n <html>\n <head>\n <title>My magic web page</title>\n </head>\n <body>\n 12345678\n </body> </html> ----- Or maybe replace the value 12345678 above with: Value=12345678 /pwm On Thu, 18 Nov 2010 mi...@na... wrote: > Perhaps look at the MSDN documents. > > Or try explaining by what you mean "send an integer or string to a web > brower" in a little more detail. > > -Mike. > > ----- Original Message ----- > From: "Jason Spalding" <jsp...@gm...> > To: "William Mc Coy" <wil...@ms...> > Cc: <sty...@ya...>; <arl...@ms...>; > <dev...@li...>; <pet...@ao...>; > <pw...@ia...>; <gru...@co...>; <mpa...@ao...>; > <joa...@ya...> > Sent: Thursday, November 18, 2010 12:07 PM > Subject: Re: [Dev-C++] (no subject) > > > >I am trying to send a interger from Visual Studio 2010 using C++ to a > > web browsers. I'd also like to send a string. Can anyone suggest a > > resource to look at or advice? > > > > Jason > > > >> _______________________________________________ > >> Dev-cpp-users mailing list > >> Dev...@li... > >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >> > >> > > > > ------------------------------------------------------------------------------ > > Beautiful is writing same markup. Internet Explorer 9 supports > > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > > Spend less time writing and rewriting code and more time creating great > > experiences on the web. Be a part of the beta today > > http://p.sf.net/sfu/msIE9-sfdev2dev > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |