Response.BufferOutput = False Response.Clear() Response.AppendHeader("Content-Disposition", "attachment; filename=" & System.IO.Path.GetFileName(fullFileName)) Response.ContentType = "application/octstream" Response.CacheControl = "Private" Dim stm As Stream = New FileStream(fullFileName, FileMode.Open, FileAccess.Read, FileShare.Read) 'Stream stm=new FileStream(文件路径,FileMode.Open ,FileAccess.Read,FileShare.Read); Response.AppendHeader("Content-length", stm.Length.ToString()) Dim br As BinaryReader = New BinaryReader(stm) 'BinaryReader br = new BinaryReader(stm); Dim bytes As Byte() Dim x As Int64 For x = 0 To (br.BaseStream.Length / 4096) bytes = br.ReadBytes(4096) Response.BinaryWrite(bytes) System.Threading.Thread.Sleep(5) Next stm.Close() 有上面的代码后面加扣除积分的代码C#的代码你自己转吧
Response.Clear()
Response.AppendHeader("Content-Disposition", "attachment; filename=" & System.IO.Path.GetFileName(fullFileName))
Response.ContentType = "application/octstream"
Response.CacheControl = "Private"
Dim stm As Stream = New FileStream(fullFileName, FileMode.Open, FileAccess.Read, FileShare.Read) 'Stream stm=new FileStream(文件路径,FileMode.Open ,FileAccess.Read,FileShare.Read);
Response.AppendHeader("Content-length", stm.Length.ToString())
Dim br As BinaryReader = New BinaryReader(stm) 'BinaryReader br = new BinaryReader(stm);
Dim bytes As Byte()
Dim x As Int64
For x = 0 To (br.BaseStream.Length / 4096)
bytes = br.ReadBytes(4096)
Response.BinaryWrite(bytes)
System.Threading.Thread.Sleep(5) Next stm.Close()
有上面的代码后面加扣除积分的代码C#的代码你自己转吧