C# winformÓë flash as µÄ½»»¥Í¨Ñ¶
Ò»¡¢»ù±¾ÔÀí¼°¹ý³Ì
Flashͨ¹ýExternalInterfaceÀàÓëÈÝÆ÷Ó¦ÓóÌÐò½øÐÐͨÐÅ¡£Îª´Ë£¬ExternalInterfaceÀàÌṩÁ½¸ö¾²Ì¬ÊôÐÔºÍÁ½¸ö¾²Ì¬·½·¨¡£
ExternalInterface.call(“º¯ÊýÃû”£¬[²ÎÊý…])·½·¨Ö´ÐÐÈÝÆ÷Ó¦ÓóÌÐòµÄ´úÂ룬¸Ã·½·¨ÖÁÉÙÐèÒªÒ»¸ö×Ö·û´®²ÎÊýÀ´Ö¸¶¨Òªµ÷Óõĺ¯ÊýÃû£¬ÆäËüÈκβÎÊý½«×÷Ϊ²ÎÊý±»´«µÝ¸ø±»µ÷Óú¯Êý¡£ÔÚ³ýä¯ÀÀÆ÷ÍâµÄÆäËüÈÝÆ÷ÖУ¬´Ë·½·¨µ÷Óý«µ¼ÖÂflash player ActiveX¿Ø¼þµÄflashcallʼþ·¢Éú¡£Flash Player ½«Ö¸¶¨µÄº¯ÊýÃû¼°ËùÓвÎÊýÐòÁл¯ÎªÒ»¸ö XML ×Ö·û´®¡£ÈÝÆ÷¿ÉÒÔÔÚʼþ¶ÔÏóµÄ request ÊôÐÔÖзÃÎʸÃÐÅÏ¢£¬²¢ÓÃËüÀ´È·¶¨ÈçºÎÖ´ÐÐËü×Ô¼ºµÄ´úÂ롣ΪÁ˽«Öµ·µ»Ø ActionScript£¬ÈÝÆ÷´úÂëµ÷Óà ActiveX ¶ÔÏóµÄ SetReturnValue() ·½·¨£¬²¢½«½á¹û£¨ÐòÁл¯ÎªÒ»¸ö XML ×Ö·û´®£©×÷Ϊ¸Ã·½·¨µÄ²ÎÊý½øÐд«µÝ¡£——ÒÔÉÏÕª×Ô°ïÖúÎĵµ
Æä»ù±¾¹ý³ÌΪ£ºflashµ÷Ó×>flash×Ô¶¯½«²ÎÊý´ò°üΪxml—>½«xml´«µÝ¸øC# —>C#½âÎö²ÎÊýµÃµ½º¯ÊýÃûÓë²ÎÊýÖµ—>Ö´ÐÐC#º¯Êý—>½«·µ»ØÖµ´ò°üΪxml—>½«xmlÎļþ·¢ËÍ»Øflash—>flash×Ô¶¯½âÎöxmlµÃµ½·µ»ØÖµ
´ÓÈÝÆ÷Öе÷Óà ActionScript ´úÂë±ØÐëÖ´ÐÐÁ½Ïî²Ù×÷£ºÏò ExternalInterface Àà×¢²áº¯Êý£¬È»ºó´ÓÈÝÆ÷µÄ´úÂëµ÷ÓÃËü¡£ÔÚÔËÐÐÓŲ́ʽ»úÓ¦ÓóÌÐòÖе÷Óà ActionScript º¯Êýʱ£¬±ØÐ뽫ÒÑ×¢²áµÄº¯ÊýÃû¼°ËùÓвÎÊýÐòÁл¯ÎªÒ»¸ö XML ¸ñʽµÄ×Ö·û´®¡£È»ºó£¬½«¸Ã XML ×Ö·û´®×÷Ϊһ¸ö²ÎÊýÀ´µ÷Óà ActiveX ¿Ø¼þµÄ CallFunction() ·½·¨£¬ÒÔʵ¼ÊÖ´Ðиõ÷Óá£
Æä»ù±¾¹ý³ÌΪ£ºflashÖÐ×¢²áº¯Êý——½«Òªµ÷Óõĺ¯ÊýÃû¡¢²ÎÊýµÈÐÅÏ¢´ò°üΪxml—>½«xml´«µÝµ½flashÖÐÖ´Ðе÷Ó×>Ö´ÐÐActionScriptº¯Êý—>flash×Ô¶¯½«½á¹û´ò°üΪxml—>½«½á¹ûxml´«µÝ»ØC# —>C#½âÎöxmlµÃµ½·µ»ØÖµ
¿É¼û£¬flashÓëC#ͨÐÅÊÇͨ¹ýÌض¨¸ñʽµÄxmlÎļþ½øÐеģ¬Òò´ËΪÁËʵÏÖͨÐÅ£¬C#±ØÐëʵÏÖһϹ¦ÄÜ£ºÊ¶±ð¸Ãxml¸ñʽÒԵõ½flash·¢ËÍÀ´µÄÐÅÐÄ£¬½«ÐèÒª´«Ë͸øflashµÄÐÅÏ¢´ò°ü³ÉflashÄÜʶ±ðµÄxml¸ñʽ¡£ÎªÁËʹÓ÷½±ãÎÒÃÇ¿ÉÒÔÉè¼ÆÒ»¸ö´úÀíÀàרߺÔðÊý¾ÝµÄ½âÎöÓë´ò°ü¹¤×÷£¬ÕâÑùÎÒÃǾͿÉÒÔ͸Ã÷µÄʹÓøôúÀíÀàÀ´ÊµÏÖflashÓëC#¼äµÄ»¥Ïàµ÷Óá£
ÔÚflashµÄʾÀýÖÐÓÐÒ»¸öIntrovertIM_CSharpÏîÄ¿½ÏºÃµÄʵÏÖÁË´úÀíµÄ±àд£¬Ò»°ãÇé¿öÏ£¬Ê¹ÓøÃʾÀýÖеÄExternalInterfaceProxyÀà×ãÒÔÂú×ãÒªÇó£¬Òò´Ë·½±ãÆð¼ûÎÒÒ²Ö±½Ó²ÉÓÃÁ˸ôúÀíÀà¡£
¸ÃÀàµÄʹÓ÷dz£¼òµ¥
Ïà¹ØÎĵµ£º
1¡¢C/C++³ÌÐòÔ±Çë×¢Ò⣬²»ÄÜÔÚcaseÓï¾ä²»Îª¿Õʱ“ÏòÏÂÖ´ÐД¡£
¡¡¡¡2¡¢ÖµÀàÐͺÍÒýÓÃÀàÐÍÖ®¼äµÄÇø±ð£ºC#µÄ»ù±¾ÀàÐÍ(int£¬charµÈ)¶¼ÊÇÖµÀàÐÍ£¬ÊÇÔÚÕ»Öд´½¨µÄ¡£¶ø¶ÔÏóÊÇÒýÓÃÀàÐÍ£¬´´½¨ÓÚ¶ÑÖУ¬ÐèҪʹÓùؼü×Önew¡£
¡¡¡¡3¡¢ÔÚC#ÖÐͨ¹ýʵÀý·ÃÎʾ²Ì¬·½·¨»ò³ÉÔ±±äÁ¿ÊDz»ºÏ·¨µÄ£¬»áÉú³É±àÒëÆ÷´íÎó¡£µ«ÊÇÎÒÃÇ¿ÉÒÔͨ¹ýÉù ......
private void Create_Pz(string Sourcename)
{
string OutMsg;
SqlParameter[] sortPara = { new SqlParameter("@ps_IsType", Pz ......
SqlserverÕⶫÎ÷ûÉÙ¸úËû´ò½»µÀ,¸Õѧ¿ª·¢ÓïÑÔʱ¾ÍÒѾ¸úËû½Ó´¥ÁË,²»ÒªËµºÜ¾«Í¨,µ«¾ÍÓï·¨»¹ËãÊÇÊìϤ,µ«ÏÖÔÚ¿ªÊ¼Ð´C#,·¢ÏÖºÜC#¶àÁËÒ»ÖÖSqlServerµÄ²ÎÊý´«È뷽ʽ,ÒÔÍùÎÒÃdz£³£¶ÔÒª´«²ÎµÄSqlÓï¾ä¶¼ÊÇÖ±½Óͨ¹ýÆ´´ÕSqlÓï¾äµÄ·½Ê½À´ÊµÏÖ,µ«ÏÖÔÚC#ΪʲôҪרÃÅ×öÒ»¸öSql²ÎÊýµÄÀàÀ´ÊµÏÖÄØ,¾¹ý²éÕÒ²ÅÖªµÀ,ÕâÑù×öÊÇÓеÀÀíµÄ,Ò»Ê ......
½üÀ´ORM±äµÃÔ½À´Ô½Æձ飬Õⶼ¹éÓÚÒ»Öֺܾß˵·þÁ¦µÄÔÒò£»Ëü¿ÉÒÔʹ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÓ¦ÓóÌÐò±äµÃ¸ü¿ì¡¢¸üÊ¡Á¦¡£µ«ÊÇORM¿ò¼Ü¶¼Óе㓹ÌÖ´¼º¼û”£¬ËûÃÇÆÚÍû¿ª·¢Õß×ñ´ÓÌض¨µÄ¹æÔò£¬µ±¹æÔò±»´òÆƵÄʱºò¾Í·Ç³£ÄÑÒÔʹÓá£×îͨ³£µÄ¹æÔòÖ®Ò»¾ÍÊÇ£¬´æ´¢¹ý³Ì±ØÐë×ÜÊÇ·µ»Øµ¥¶ÀµÄ½á¹û¼¯£¬ÆäÖд ......
ÕâЩÌìÒòΪ¹¤×÷ÐèÒª£¬Òª½«Ò»Ð©htmlÎļþת»»ÎªchmÎļþ£¬µ±È»ÊÇÐèÒªºÍ³ÌÐò½áºÏÔÚÒ»Æð¡£
ºóÀ´ÕÒµ½NDoc£¬ÀïÍ·ÓÐÒ»¶Î´úÂëÊÇÏà¹ØµÄ£¬ÓÚÊÇ¿ªÊ¼·ÖÎö´úÂ룬дÍêÖ®ºó£¬×ܽ᣺Ö÷ÒªÊÇÀûÓÃ΢ÈíµÄhhc.exeÀ´±àÒëhtmlÎļþ£¬³ÌÐòÐèÒª½«¾ßÌåµÄÊý¾ÝдÈëhhpºÍhhcÎļþ¡£
Ö÷Òª´úÂëÈçÏ£º
¸´ÖÆC#´úÂë±£´æ´úÂëpublic void CompileProject()
{ ......