许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  Flex与.NET交互开发教程

Flex与.NET交互开发教程

阅读数 2
点赞 0
article_banner

方法一:

把Flex生成的SWF文件(在目录../history/xx.swf)中,考到.NET项目( WEB )中,然后在页面上引用就可以了。如

<body style="margin:0px;" mce_style="margin:0px;"> < form   id="form1" runat="server"> <div> <embed src="FlexNet.swf" mce_src="FlexNet.swf" width="100%" height="100%" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always"></embed> </div> </form> </body>

方法二:

调用.NET页面。示例如下:

在Flex文件中:

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=" http  ://www.adobe.com/2006/mxml" layout="horizontal" textAlign="center" width="100%" height="100%"> <mx:HTTPService showBusyCursor="true" id="getuser" result="getuserproc();" url="http://localhost:54062/FLEX/Default.aspx"> <mx:request> <username> {this.txtUserName.text} </username> <userpassword> {this.txtUserPassWord.text} </userpassword> </mx:request> </mx:HTTPService> <mx:Script> <!--[CDATA[ import mx.controls.Alert; import mx.rpc.AbstractOperation; public function getuserproc():void { var returnValue:String=getuser.lastResult.Result.user; switch(returnValue) { case "ok": Alert.show("您成功的登录了","提示信息",Alert.OK,this,null,null,Alert.YES); break; case "pwderror": Alert.show("密码错误,登录失败","提示信息",Alert.OK,this,null,null,Alert.YES); break; case "uiderror": Alert.show("无此用户名,登录失败","提示信息",Alert.OK,this,null,null,Alert.YES); break; } } ]]--> </mx:Script> <mx:Panel id="UserRegPanel" x="9.15" y="9.05" title="用户登录" width="302" height="204" layout ="absolute" textAlign="left"> <mx:Label x="10" y="22" text="用户名:" id="lblUserName" enabled="true" fontSize="15"/> <mx:Label x="10" y="64" text="密 码:" id="lblUserPassWord" enabled="true" fontSize="15"/> <mx:TextInput x="83" y="22" fontSize="15" id="txtUserName"/> <mx:TextInput x="83" y="63" fontSize="15" id="txtUserPassWord" displayAsPassword="true"/> <mx:Button x="96.45" y="108" label="登录" width="89" height="36" fontSize="15" enabled="true" click="getuser.send()"> </mx:Button> </mx:Panel> </mx:Application>

Default.aspx.cs:

protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["username"] != null && Request.QueryString["userpassword"] != null) { if (Request.QueryString["username"].Equals("drj") && Request.QueryString["userpassword"].Equals("123")) { Response.Write("<Result><user>ok</user></Result>"); Response.Flush(); } else if (!Request.QueryString["username"].Equals("drj")) { Response.Write("<Result><user>uiderror</user></Result>"); Response.Flush(); } else if (!Request.QueryString["userpassword"].Equals("123")) { Response.Write("<Result><user>pwderror</user></Result>"); Response.Flush(); } } }


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空