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实现向ASP.NET发送HTTPService请求的过程。同时,文中指出在使用e4x样式时必须返回XML格式的文件,避免了因格式不匹配导致的错误。
186

被折叠的 条评论
为什么被折叠?



