asp.net向网页输出文件及flex发送HttpService的总结(个人笔记)

1)今天才知道asp.net可以直接往网页写文件,失误啊,方法如下,result是文件路径           

Response.WriteFile(result);

Response.End();

2)flex向asp.net发送HttpService请求,代码如下,asp.net中用Response.Write()输出字符串,

var configService:HTTPService = new HTTPService();
configService.url = Url;
configService.method="post";
configService.resultFormat = "e4x";

configService.addEventListener(ResultEvent.RESULT, Relistener);
configService.addEventListener(FaultEvent.FAULT, configFault);
configService.send(paras); 

然而flex中却发生错误

Error

#1088:

文档中根元素后面的标记格式

 , 并激发ResultEvent.RESULT事件,通过分析才知道“ configService.resultFormat = "e4x"; ”,使用e4x格式必须返回xml格式的文件才行,将这段代码注释即可解决。


你可能感兴趣的:(asp.net向网页输出文件及flex发送HttpService的总结(个人笔记))