For ASP. NET pages that have been loaded for a long time, we can display a progress bar in the client browser to show that the page is being loaded. The specific implementation process is as follows:
1. Create a project named webportal. In the
Save the following as pack. asp and run it When packaging the file
CopyCode The Code is as follows:
file Packaging
Program
Dim zippathdir, zippathfileDim startime, endtime'Change the path of the folder to be packaged
Pack the file into an XML file package. It is an ASP tool that can be unwrapped!
Package all the website source code into the XML file, generate the updata. xml file, and upload the XML file to the space.Then, release all the files through the
Response. buffer = true
'Application Cache Technology.
Dim lostnum
'PreventDmaxToo largeDstepToo small.
Dim shownum
Delayshow (dstep, dmax)
Sub delayshow (dstep, dmax)
'DmaxIndicates the number of requests to be processed.Dmax (Step)To complete the
Below is a table of Response Properties along with examples and explanations.
Response Properties
Buffer
Response. Buffer = trueAllows for the buffering of output
CacheControl
Response. CacheControl = "Public"Sets
Here, I add an HTTP header to the output stream through the AddHeader method in the Response class. The HTTP header consists of header information and body information. The two are separated by a blank line. Here, the Range segment is added to the
Response. buffer = true
'Application caching technology.
Dim lostnum
'Prevent dmax from being too large and dstep from being too small.
Dim shownum
Delayshow (dstep, dmax)
Sub delayshow (dstep, dmax)
'Dmax indicates the number of dmax (Steps) to be
The BufferOutput attribute is used to obtain or set a value indicating whether to buffer the output and send it after processing the complete page. The default value of this attribute is true. Therefore, the output content on the page is usually
For ASP. NET pages that have been loaded for a long time, we can display a progress bar in the client browser to show that the page is being loaded. The specific implementation process is as follows:
Create a project named webportal. In the
Create a web project, add a new project> HTML page, and name it progressbar.htm. The content is as follows:
No title page ";Response. Write (jsblock );Response. Flush ();}
Private void finishprogress (){String jsblock = " ";Response. Write
Method 1:// ***********************************> Download /// /// Output the hard disk file, which supports large file downloads, resumable data transfer, speed restrictions, and low resource usage./// /// page. Request object /// page. Response
Using system;Using system. IO;Using system. Threading;Using system. Web;
/// /// File Download class/// Public class filedown{Public filedown (){}
/// /// The parameter is a virtual path./// Public static string filenameextension (string
Import Excel:Response. Clear ();
Response. Buffer = true;
Response. charset = "gb2312 ";
Response. appendheader ("content-disposition", "attachment?filename=filename.xls ");
// If it is set to getencoding ("gb2312"), the exported file will contain
How to download large files using ASP. Net
This article mainly introduces the implementation of ASP. Net to download large files, and analyzes in detail the ideas and precautions for downloading large files. For more information, see
This document
Implementation and code of ASP. NET large file download, asp.net File Download
File Download is the most basic function of a website, ASP. NET website file download function implementation is also very simple, but if you encounter large file
1. ExecuteNonQuery and ExecuteScalar do not need to return the result set for data update. We recommend that you use ExecuteNonQuery. Because no result set is returned, network data transmission can be saved. It returns only the number of affected
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.