下载问题 哪为大哥有asp.net下载的源代码(vb)?小弟找了好久,没有一个有用的。希望大家给我提示,小弟刚刚学习asp.net 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用c#的 fstring = 文件名 string path=Server.MapPath("./")+"/xmwd/"+fstring; System.IO.FileInfo file = new System.IO.FileInfo(path); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(file.Name)); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(file.FullName); Response.End(); return; 绝对能用的 vb代码的下载程序<%@ import namespace="system.io"%><script language="vb" runat="server">Sub page_load(sender As Object,e As eventargs)Dim path As String = "e:\web1\tan.mdb" Dim fileName As String fileName = System.IO.Path.GetFileName(path) Response.Write(fileName) Response.AddHeader("content-disposition", "attachment; filename=" & fileName & "") Dim objStream As Stream objStream = File.OpenRead(path) Dim fileLength As Integer fileLength = objStream.Length Dim fileDate(fileLength) As Byte objStream.Read(fileDate, 0, fileLength) Response.BinaryWrite(fileDate)End Sub</script><html><body>dddddd</body></html> nmlvjun(网事如风) 你好:你的代码不能用出错.能给个整体的好吗? DataTable 递归排序算法------------请高手赐教 菜鸟求救!!!gridview 分页可以嵌套吗? 求网格编辑控件 跪求 VSS 解决方案 GridView换行 为什么说索引超出了数组界限啊 在这个地方问个javascript的问题 写了个分页程序 老是出现无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。 错误,请求大家帮助 如何在vs.net的项目中让IE地址栏的URL变成乱码? 有.net的完整的权限管理的源码吗?类似java的pow2acl那样的 各位高手谢谢大家控件加载不了有什么原因啊?? 请教大家一个问题~!
fstring = 文件名
string path=Server.MapPath("./")+"/xmwd/"+fstring; System.IO.FileInfo file = new System.IO.FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(file.Name));
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
return;
<script language="vb" runat="server">
Sub page_load(sender As Object,e As eventargs)Dim path As String = "e:\web1\tan.mdb"
Dim fileName As String
fileName = System.IO.Path.GetFileName(path)
Response.Write(fileName)
Response.AddHeader("content-disposition", "attachment; filename=" & fileName & "")
Dim objStream As Stream
objStream = File.OpenRead(path)
Dim fileLength As Integer
fileLength = objStream.Length
Dim fileDate(fileLength) As Byte
objStream.Read(fileDate, 0, fileLength)
Response.BinaryWrite(fileDate)End Sub</script>
<html>
<body>
dddddd
</body>
</html>
你好:你的代码不能用出错.能给个整体的好吗?