How to display progress bars in ASP

Source: Internet
Author: User
Tags flush

Response.buffer=true

' Apply caching technology.

Dim lostnum

' Prevent dmax too large and dstep too small.

Dim shownum

Delayshow (Dstep,dmax)

Sub Delayshow (Dstep,dmax)

' DMax indicates how many DMax (steps) to handle to complete the process, Dstep represents the approximate percentage of the total process that has been processed.

Dim total

' Show all the pictures.

Dim dtemp

' Transition variable.

total=100

Dtemp=dstep

Dstep=dstep+lostnum

if (dstep*total)/dmax<1 Then

' When the screen is not even 1%, then do not draw, at the same time with variable Lostnum store the total number of paintings, easy to continue the next call this process.

Lostnum=lostnum+dtemp

Else

For Ccc=1 to fix ((dstep*total)/dmax)

' Take an integer.

Response.Flush

Shownum=shownum+fix ((dstep*total)/dmax)

Lostnum=0

' Displays the picture in the cache, and the variable shownum is used to store the currently painted picture.

End If

End Sub

Sub Showlost ()

For Ccc=1 to (100-shownum)

Response.Write ("


")

' If the remainder caused cannot be painted 100 times, by Showlost () the rest of the painting has not been shown as handled.

Next

Response.Write "

"

Response.Flush

End Sub

Note : For more wonderful tutorials, please pay attention to the Triple graphics tutorial channel,

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.