ÀûÓÃ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))==SOCKET_ERROR){
&n
Ïà¹ØÎĵµ£º
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
MyEclipse
FlexµÄÅäÖÃÖ®³õÎÒÃÇ¿´¿´ÔµÓÉ£ºÒ»¿ªÊ¼Ñ§Ï°Ê¹ÓÃFlexµÄʱºò,ÎÒÊÇÓõĵ¥¶ÀµÄFlexBuilder3,×öЩ´¿FlexµÄÓ¦ÓóÌÐò»¹¿ÉÒÔ.µ«ÊÇÈç¹ûÒª
ºÍJava½áºÏÔÚÒ»ÆðʹÓÃ,¼´ÀûÓÃFLEX³äµ±Ò»¸öÍêÕûµÄJ2EEϵͳµÄWEB²ãµÄ»°,ÄÇôµ¥¶ÀʹÓÃFlexBuilder3ºÍMYECLIPSEÊǺܲ»
·½±ãµÄ,´ó´óÓ°ÏìÁË¿ª·¢Ð§ÂÊ,Òò´Ë×öÁËÏÂMyEclipse+FlexµÄÅäÖÃ,´ïµ½Ö ......
flex library project : create swf , not swc , code: -locale=en_US -directory=true -output=../bin/
create zh_CN language package : bin\compc -locale=zh_CN -source-path=frameworks/projects/framework/bundles/zh_CN/src -include-resource-bundles=collections,containers,controls,core,ef ......
Dreamweaver MX 2004 »òÆäËûÎı¾±à¼Æ÷£¨ÀýÈç¼Çʱ¾£©£¬ÓÃÀ´±à¼XMLºÍActionScript´úÂë
ÈçͬËùÓеÄXMLÓïÑÔÒ»Ñù£¬ÔÚMXMLÖУ¬±êÇ©ºÍÊôÐÔ¶¼ÊÇÇø·Ö´óСдµÄ£»
ËùÓеÄÊôÐÔÖµ±ØÐëÓÃË«ÒýºÅ(")»òµ¥ÒýºÅ(°üº¬
ËùÓеıêÇ©±ØÐëÊDZպϵġ£Ã»ÓÐ×Ó±êÇ©µÄ±êÇ©¿ÉÒÔÒÔб¸ÜÖ±½Ó½áÊø£¬¶øÎÞÐè¶îÍâµÄ½áÊø±êÇ©£º
<mx:Label ......
1¡¢classµÄ¶¨ÒåÒ»¶¨ÒªÔÚºóÃæ¼Ó“£»”
2¡¢ÓÃcoutʱҪÔÚmainº¯ÊýÇ°¼Ó using namespace std;
3¡¢³öÏÖ undefined reference to `std::ios_base::Init::Init() ÌáʾµÄ»°£¬ÎÊÌâÊÇgcc±àÒëÆ÷³öÏֵģ¬½â¾öµÄ°ì·¨ÊÇ£ºÔÚlinuxϱàÒëc++ ³ÌÐòҪʹÓÃg++ ±àÒëÆ÷,Èç¹ûÄãÒªÊÇʹÓÃgcc±àÒëÆ÷¾Í»áÓÐÉÏÃæµÄ±¨´íÐÅÏ¢,Ö»ÒªÔÚÔÚgccºó¼Ó ......