解决方案 »
- iis6.0 怎么配置无后缀名页面
- 请教一个GridView和XmlDataSource的问题,十万火急,谢谢!!!!!!!
- Linq查询后数据绑定出现的错误,提示没有某某属性 !~~
- FCKeditor 英文乱码问题,高手请进
- Panel动态添加控件后的位置问题
- 我在IHttpHandler里 context.RewritePath("login.aspx")
- DataGrid和CheckBox的问题
- 奇怪,今天刚用2005中的reportviewer控件,但为什么printbutton老显示不出来?
- asp.net遇到的问题,,,求助
- 有人用win2003+iis6+ASP.net成功运行一个aspx吗?
- 这个日历插件有人用过吗?
- 客户信息被篡改,严重问题
http://www.cnblogs.com/akwwl/p/3184239.html
http://www.michielpost.nl/Silverlight/MultiFileUploader/
//上传控件设置
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/shangchuan.JPG"
onclick="ImageButton1_Click" />
//上传程序
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string serverPath = Server.MapPath("UpLoad"); //获取服务器端目录绝对路径
if (!System.IO.Directory.Exists(serverPath)) //如果不存在该目录
{
System.IO.Directory.CreateDirectory(serverPath); //创建该目录
}
if (FileUpload1.HasFile) //判断是否选择上传的文件
{
int filesize = FileUpload1.PostedFile.ContentLength / 1024 / 1024;//获取上传文件的大小
if (filesize > 8) //如果大于8M
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('只允许上传不大于8兆的文件');", true); //弹出提示信息
return;
}
else //否则
{
//使用SaveAs方法将上传的文件存储到服务器中
FileUpload1.SaveAs(serverPath + "\\" + FileUpload1.FileName);
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('上传成功');", true);
}
}
else //如果没有选择文件
{
//弹出提示信息
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请选择文件');", true);
return;
}
自己搜搜
添加引用top4net.dll到你的程序中http://download.csdn.net/detail/sinbas/8028465
baidu api
http://developer.baidu.com/wiki/index.php?title=docs/pcs/rest/file_data_apis_list#.E4.B8.8A.E4.BC.A0.E5.8D.95.E4.B8.AA.E6.96.87.E4.BB.B6