一般应用程序(*.ashx)注意事项

来源:互联网 发布:单片机创新大赛 编辑:程序博客网 时间:2024/06/05 09:57

当前上下文 httpcontext.current 

获取 get 或post  httpcontext.current.request.methodetype(得到是大写字符串)

获取form中的数据 httpcontext.current.request.form[index or name];

验证是cs两边都要验证

获取服务器文件路径 httpcontext.current.server.mappath(filename)

写模板是用占字符,之后 用file.readalltext得到的取代占字符.

返回文本解析 httpcontext.current.contexttype="text/html"  \ "text\plait"

如果用到sqldatareader,注意要不用using,而是在 返回出close掉,当然大数据才用阅读器,否则用sqldataadapter.


原创粉丝点击