System.IO.Stream iStream =null; // Buffer to read 10K bytes in chunk: byte[] buffer =new Byte[10240]; // Length of the file: int length; // Total bytes to read: long dataToRead; // Identify the file to download including its path. string filepath =@"E:\software\SQL Server 2000 Personal Edition.ISO"; // Identify the file name. string filename = System.IO.Path.GetFileName(filepath); try { // Open the file. iStream =new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read,System.IO.FileShare.Read); Response.Clear(); // Total bytes to read: dataToRead = iStream.Length; (编辑:aniston)
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved 京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089