摘要: 通过web进行文件上传,一般要使用form表单,在silverlight里面没有内置form表单功能,参考牛人文章,实现Silverlight文件上传。只要Web.config文件中httpRuntime节点的maxRequestLength属性足够大,上传就不受限制。项目结构图:MainPage类源码:View Code 1 namespace SilverlightDownAndUploadFile 2 { 3 public partial class MainPage : UserControl 4 { 5 private OpenFileDi... 阅读全文
posted @ 2013-01-16 16:43 liancs 阅读(1525) 评论(0) 推荐(2) 编辑
摘要: 文件下载通常采用附件的方式在http响应头里面设置Content-disposition值为"attachment;filename=" + filepath,以及为Content-Length设置下载文件总长度(单位字节)来实现。本文是采用Silverlight实现文件下载,服务端用asp.net一般处理程序(.ashx)处理。以下是项目结构图:MainPage类源码如下:View Code 1 namespace SilverlightDownAndUploadFile 2 { 3 public delegate void SaveFileHandler(int byt 阅读全文
posted @ 2013-01-16 16:20 liancs 阅读(986) 评论(0) 推荐(2) 编辑