Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÀûÓÃSocketʵÏÖC++ÓëFlexͨÐÅ


ÀûÓÃSocketʵÏÖC++ÓëFlexͨÐÅ
Ò»¡¢C++·þÎñÆ÷¶Ë
£¨ÓõÄÊÇVisual Studio 2008£¨05£¬03µÄÓ¦¸ÃÒ²¿ÉÒÔ£¬VC++µÄ¿ÉÄÜÐèÒªÉÔ΢¸Ä¶¯£©£©
´úÂëÈçÏ£º
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;
#pragma comment(lib,"ws2_32.lib")
 
void main(){ 
 WORD wVersionRequested;
 WSADATA wsaData;
 int err;
 short port=1300;//¶Ë¿ÚºÅ
 
 wVersionRequested = MAKEWORD( 1, 1 );
 
 err = WSAStartup( wVersionRequested, &wsaData );//³õʼ»¯Ì×½Ó×Ö
 if ( err != 0 )
 {
    return;
 }
 
 if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 )
 {
    WSACleanup( );
    return;
 }
 
 SOCKET sockSrv=socket(AF_INET,SOCK_STREAM,0);//´´½¨Ì×½Ó×Ö
 SOCKET sockConn;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×Ö
 
 SOCKADDR_IN addrSrv;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×ÖµØÖ·
 
 addrSrv.sin_addr.S_un.S_addr=htonl(INADDR_ANY);
 addrSrv.sin_family=AF_INET;
 addrSrv.sin_port=htons(port);
 
 bind(sockSrv,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR));//°ó¶¨¶Ë¿Ú
 
 listen(sockSrv,5);//ÕìÌý
 
printf("Server %d is listening......\n",port);
 
 SOCKADDR_IN addrClient;
 
 int len=sizeof(SOCKADDR);
 
char buf[4096];//½ÓÊÕµÄÊý¾Ý
char rbuf[100]="³É¹¦";//·µ»ØµÄÊý¾Ý
 
 while(1)
 {
        //½ÓÊÜÁ¬½Ó
         sockConn=accept(sockSrv,(SOCKADDR*)&addrClient,&len);
         printf("Accept connection from %s\n",inet_ntoa(addrClient.sin_addr));
 
         //½ÓÊÕÊý¾Ý
         int bytes;
         if((bytes=recv(sockConn,buf,sizeof(buf),0))==


Ïà¹ØÎĵµ£º

LinusΪʲô²»ÓÃC++дLinuxÄںˣ¿

ÔÚ×î½üµÄÒ»¸ö¹ØÓÚLKMLµÄÌÖÂÛÖУ¬Linus¸ø³öÁËΪʲô²»ÓÃC++À´Ð´LinuxÄں˵ÄÀíÓÉ£º
"In fact, in Linux we did try C++ once already, back in 1992. It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.
“ÊÂʵÉÏ£¬ÎÒÃÇÔø¾­³¢ÊÔ¹ýÓÃC++À´Ð´£¬ÊÇÔÚ1992ÄêµÄʱºò¡£ºÜÔã¸â¡£ÏàÐÅÎÒ--ÓÃC++À´Ð´ÄÚºË ......

PHP >C++ת»»¹¤¾ß

   ÎãÓ¹ÖÃÒÉ£¬PHPÊÇÒ»Öַdz£°ôµÄ¶¯Ì¬ÍøÒ³ÖÆ×÷ÓïÑÔ£¬ËûºÍCµÄ¼«¸ßÏàËÆÐÔ£¬Ê¹µÃËüµÄÓ﷨ѧÆðÀ´
ºÜÈÝÒ×£¬ËûÓкܶàÀàËÆCÓïÑԿ⺯ÊýµÄ¶«Î÷£¬»¹ÓÐÏñÈÕÆÚ£¬×Ö·û´®ºÍʱ¼äº¯ÊýµÈ£¬ÕâʹµÃËüºÜÈÝ
Ò׿ª·¢Ï൱¸´ÔÓµÄÓ¦ÓóÌÐò¡£
    µ±PHPÓ¦Óõ½¹Ø¼üwebÕ¾µãÉÏ£¬ÈçºÎ±£Ö¤ÖÊÁ¿½«»á±äµÃºÜ¹Ø¼ü¡£È»¶ø£¬PHP²¢²»ÊÇÒ» ......

flex 3 ´ÓÒ³ÃæurlÖÐÈ¡²ÎÊýÈ¡ÖµµÄÍêÃÀ½â¾ö·½°¸

1:µ±ÓÃhttp://xxxxx/xxx.mxml?name=hermit·½Ê½·ÃÎÊ ¿ÉÒÔÓÃthis.parameters.nameÕâÖÖ·½Ê½ÔÚflexÀïÃæÈ¡url²ÎÊý
2:µ±ÓÃhttp://xxxxx/xxx.swf?name=hermit·½Ê½·ÃÎÊ ¿ÉÒÔÓÃthis.parameters.nameÕâÖÖ·½Ê½ÔÚflexÀïÃæÈ¡url²ÎÊý
3:µ±ÓÃhttp://xxxxx/xxx.html?name=hermit·½Ê½·ÃÎÊ ¿ÉÒÔÓÃthis.parameters.nameÕâÖÖ·½Ê½ÔÚflexÀïÃæÈ ......

flex xmlºÍarraycollectionÏ໥ת»»

1¡¢arraycollectionת»¯Îªxml£¬´úÂëÈçÏ£º
    
    //¶¯Ì¬Éú³ÉÊ÷Ðνṹ
public static function flatArrayToXML(arr:Object,rootname:String=null,nodename:String=null, outputString:Boolean=false):Object{
if (arr is Array){

......

flex ±Ê¼Ç£¨¸üÐÂÖС£¡£¡£¡££©

1¡¢Èç¹ûÒªÉèÖÃValidatorÑéÖ¤×é¼þÀïÃæÌáʾ×ֵĴóС£¬¿ÉÒÔÔÚmxmlÖмÓÈë
    <mx:Style>
<!--[CDATA[
.errorTip
{
fontSize: 12;
}
]]-->
</mx:Style>
2¡¢ÉèÖÃtooltipÖеÄÑùʽ£¨Èç×ÖÌå´óС£¬ÑÕÉ«£©¿ÉÔÚmxmlÖеÄcreationCompleteµÄinitApp()¼ÓÈë
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ