Asp.net + Flex实现网络硬盘
程序架构很简单就是用Flex作为应用端表现,asp.net用作逻辑服务提供;Flex通过HttpService来调用相关服务。具体细节就不说了程序提中所有源码都能提供下载,想更多了解Flex相关东西的朋友可以下载源码了解一下。
简单描述一下Flex逻辑接口定义和asp.net服务端逻辑关系:
程序结构
asp.net:
/// <summary>
/// 注册
/// </summary>
[ActionMapper]
public class Register:Smark.Web.Action
{
public User User
{
get;
set;
}
protected override void OnExecute()
{
IV.Check();
User.Enabled = true;
User.UploadSize = 10240;
User.Save();
System.IO.Directory.CreateDirectory(Untity.RootPath + User.UserName);
base.OnExecute();
}
public Smark.Web.Actions.ImageValidate IV
{
get;
set;
}
}
ActionScript:
public dynamic class IRegister extends HttpBase
{
public function IRegister(method:String="get", result:Function=null)
{
super("Register", method, result);
}
public var UserName:String;
public var UserPWD:String;
public var EMail:String;
public var ImgSN:String;
public var ImgKey:String;
}
接口调用
mRegister.EMail=txtEMail.text;
mRegister.ImgKey = txtImgCode.ImageKey();
mRegister.ImgSN = txtImgCode.ImageSN();
mRegister.UserName = txtName.text;
mRegister.UserPWD = txtPWD.text;
mRegister.Open();
网络硬盘开放接口:
http://smark.nbao.net/services.aspx?do=api
演示和代码下载: