Dim f As String = Nothing dddd() System.Threading.Thread.Sleep(2000)Dim filepath As String = FileUpload1.PostedFile.FileName Dim filename As String = filepath.Substring(filepath.LastIndexOf("\") + 1) Dim spath As String = Server.MapPath("uploadfile/") & Request("acid") ddd()是一个进度条,可它不先显示进度条而是一起做完了
输出的顺序不会受影响的
只是你响应多等了5秒钟
Dim filename As String = filepath.Substring(filepath.LastIndexOf("\") + 1)
Dim spath As String = Server.MapPath("uploadfile/") & Request("acid")
ddd()是一个进度条,可它不先显示进度条而是一起做完了
Response.Flush();
System.Threading.Thread.Sleep(5000)
Response.Write("bbbb")
Response.Flush();
Response.Write("aaaa")
Response.Flush()
System.Threading.Thread.Sleep(5000)
Response.Write("bbbb")
Response.Flush()Button1不能先起作用
你在Response.Write("<用js设置它的属性试试>")
<%@ Import Namespace="System.Threading" %>
<% this.Response.Buffer = false; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>loading...</title>
<style type="text/css">
Html, Body {
width: 100%;
height: 100%;
border: 0px;
padding: 0px;
margin: 0px;
overflow: hidden;
}
</style>
</head>
<body>
<script>
window.$ = function(dValue) {
return document.getElementById(dValue)
}
</script>
<table width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<div style="width: 400px; height: 25px; border: #CCCCCC 1px solid; text-align: left;">
<div id="Percent" style="width: 0px; height: 25px; overflow: hidden; background: #CCCCCC;"></div>
</div>
</td>
</tr>
<tr>
<td height="30%"></td>
</tr>
</table>
</body>
<%
for (Int32 i = 0; i <= 400; i += 5) {
if (this.Response.IsClientConnected == false) continue;
Thread.Sleep(100);
this.Response.Write("<script>$(\"Percent\").style.width = \"" + i.ToString() + "px\"</script>\n");
}
%>
</html>
JJ好痒