如何做一个等待页面!

wxyzy 2004-08-30 05:44:44
我的程序运行时间长 当运行时出现提示请等待 运行完后提示消失
...全文
366 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
goody9807 2004-09-13
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemThreadingThreadClassSleepTopic2.asp



[Visual Basic]
Imports System
Imports System.Threading

' Simple threading scenario: Start a Shared method running
' on a second thread.
Public Class ThreadExample
' The ThreadProc method is called when the thread starts.
' It loops ten times, writing to the console and yielding
' the rest of its time slice each time, and then ends.
Public Shared Sub ThreadProc()
Dim i As Integer
For i = 0 To 9
Console.WriteLine("ThreadProc: {0}", i)
' Yield the rest of the time slice.
Thread.Sleep(0)
Next
End Sub

Public Shared Sub Main()
Console.WriteLine("Main thread: Start a second thread.")
' The constructor for the Thread class requires a ThreadStart
' delegate. The Visual Basic AddressOf operator creates this
' delegate for you.
Dim t As New Thread(AddressOf ThreadProc)
' Start ThreadProc. On a uniprocessor, the thread does not get
' any processor time until the main thread yields. Uncomment
' the Thread.Sleep that follows t.Start() to see the difference.
t.Start()
'Thread.Sleep(0)

Dim i As Integer
For i = 1 To 4
Console.WriteLine("Main thread: Do some work.")
Thread.Sleep(0)
Next

Console.WriteLine("Main thread: Call Join(), to wait until ThreadProc ends.")
t.Join()
Console.WriteLine("Main thread: ThreadProc.Join has returned. Press Enter to end program.")
Console.ReadLine()
End Sub
End Class
wangdequan1024 2004-09-02
  • 打赏
  • 举报
回复
学习
wxyzy 2004-09-02
  • 打赏
  • 举报
回复
我不想设置具体的秒数
不要Thread.Sleep(3000)
有没有让线程一直睡眠等待 ,然后等大程序执行完后 再用程序唤醒
孟子E章 2004-08-31
  • 打赏
  • 举报
回复
可以啊。这个看你的需要,可以随意安排你的显示位置和时间
DotSharp 2004-08-31
  • 打赏
  • 举报
回复
用脚本这样写:
把如下代码加入<body>区域中
<script language="javascript">
function opencolortext(){
window.open('http://www.990.net','colortext')
}
setTimeout("opencolortext()",3000)
</script>


正在下载文件,请耐心等待......
Proyang 2004-08-31
  • 打赏
  • 举报
回复
====================================

点按钮后,你就执行
window.showmodelwindow(一个页面A)
而asp.net的机制就是自动postback。
所以在你执行完毕后,你的页面A就自动关闭了,很好用的。
这里利用了showmodelwindow函数的特性,和ASP。NET的特点。
而你在页面A上,可以写一些提示文字。

====================================
Jinniu 2004-08-31
  • 打赏
  • 举报
回复
这个就要看你对时间的把握了!
wxyzy 2004-08-31
  • 打赏
  • 举报
回复
孟大哥
http://dotnet.aspx.cc/ShowDetail.aspx?id=794566B9-5EA2-4782-2D42-E133F3C7BA74

我看过了 谢谢

有个问题
有些不准确 就是我点按钮后 运行完后 进入等待界面 但已经出来了保存成功,那个等待界面才消失 ,能不能让等待界面先消失 后出保存成功!
wxyzy 2004-08-31
  • 打赏
  • 举报
回复
孟大哥

<script>
function init() {
if(document.getElementById)
document.getElementById("mh").style.visibility="hidden";
else
document.mh.visibility='hide'
}
</SCRIPT></HEAD>
<BODY onload="init()">

<div id="mh" align="center" style="position:absolute;width:100%;height:26;top:0;left:0;visibility:visible;z-index:200;color:#ffffff">正在下载,请稍侯…………!如果顶层菜单长时间不能显示,请按停止按钮或者按刷新按钮!!</div>

1.有问题 报脚本错误
2.document.mh.visibility='hide' 是什么意思 为什么不用hidden
xiaomaolover 2004-08-30
  • 打赏
  • 举报
回复
每隔10秒刷新一次.

"请稍侯…………!"

Response.Redirect("a.aspx")
goody9807 2004-08-30
  • 打赏
  • 举报
回复
用div 的隐藏和显示
孟子E章 2004-08-30
  • 打赏
  • 举报
回复
<script>
function init() {
if(document.getElementById)
document.getElementById("mh").style.visibility="hidden";
else
document.mh.visibility='hide'
}
</SCRIPT></HEAD>
<BODY onload="init()">

<div id="mh" align="center" style="position:absolute;width:100%;height:26;top:0;left:0;visibility:visible;z-index:200;color:#ffffff">正在下载,请稍侯…………!如果顶层菜单长时间不能显示,请按停止按钮或者按刷新按钮!!</div>
孟子E章 2004-08-30
  • 打赏
  • 举报
回复
http://dotnet.aspx.cc/ShowDetail.aspx?id=794566B9-5EA2-4782-2D42-E133F3C7BA74

62,072

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧