.net
11 个解决方案
#1
使用System.Threading
设置Sleep为你指定的时间,时间一到
Response.Redirect即可
设置Sleep为你指定的时间,时间一到
Response.Redirect即可
#2
请问具体怎么做的呢?
能写一个例子看看吗?
能写一个例子看看吗?
#3
1.服务器段返回一个时间信息到客户端的隐含文本框
2.客户端执行JS脚本判断是否跳转
2.客户端执行JS脚本判断是否跳转
#4
在网页的head区域加入<meta http-equiv="refresh" content="转向网址;URL=时间(秒)" />
#5
对啊,我想是在服务器上让服务器处理出来,这样的话,就会自动执行,MS做出来的JS才是标准的.
有些用户的浏览器不能跳,但是用MS做的东西就能跳.就是不知道在程序里面怎么做,我就看见MS有这样的功能,5秒自动跳,随便把浏览器怎么设置.
有些用户的浏览器不能跳,但是用MS做的东西就能跳.就是不知道在程序里面怎么做,我就看见MS有这样的功能,5秒自动跳,随便把浏览器怎么设置.
#6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim script As String
script = "<script language=javascript>"
script += "setTimeout('this.location.href=""testdt.aspx""',5000)"
script += "</script>"
If (Not Me.IsStartupScriptRegistered("test")) Then
Me.RegisterStartupScript("test", script)
End If
End Sub
Dim script As String
script = "<script language=javascript>"
script += "setTimeout('this.location.href=""testdt.aspx""',5000)"
script += "</script>"
If (Not Me.IsStartupScriptRegistered("test")) Then
Me.RegisterStartupScript("test", script)
End If
End Sub
#7
private void Button1_Click(object sender, System.EventArgs e)
{
string script;
script = "<script language=javascript>";
script += "setTimeout('this.location.href=\"testdt.aspx\"',5000)";
script += "</script>";
if ((!(this.IsStartupScriptRegistered("test")))) {
this.RegisterStartupScript("test", script);
}
}
{
string script;
script = "<script language=javascript>";
script += "setTimeout('this.location.href=\"testdt.aspx\"',5000)";
script += "</script>";
if ((!(this.IsStartupScriptRegistered("test")))) {
this.RegisterStartupScript("test", script);
}
}
#8
朋友,你这不是JS吗?楼上有位朋友说的是System.Threading Namespace
JS的话可以直接写啊,谢谢
JS的话可以直接写啊,谢谢
#9
mark
#10
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
这是MS的人写的例子,不知道他到底在做什么,没有看见redirect 功能.大家帮帮忙吧
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
这是MS的人写的例子,不知道他到底在做什么,没有看见redirect 功能.大家帮帮忙吧
#11
肯定是用的这个空间命名,但是不知道具体如何设置properties
#1
使用System.Threading
设置Sleep为你指定的时间,时间一到
Response.Redirect即可
设置Sleep为你指定的时间,时间一到
Response.Redirect即可
#2
请问具体怎么做的呢?
能写一个例子看看吗?
能写一个例子看看吗?
#3
1.服务器段返回一个时间信息到客户端的隐含文本框
2.客户端执行JS脚本判断是否跳转
2.客户端执行JS脚本判断是否跳转
#4
在网页的head区域加入<meta http-equiv="refresh" content="转向网址;URL=时间(秒)" />
#5
对啊,我想是在服务器上让服务器处理出来,这样的话,就会自动执行,MS做出来的JS才是标准的.
有些用户的浏览器不能跳,但是用MS做的东西就能跳.就是不知道在程序里面怎么做,我就看见MS有这样的功能,5秒自动跳,随便把浏览器怎么设置.
有些用户的浏览器不能跳,但是用MS做的东西就能跳.就是不知道在程序里面怎么做,我就看见MS有这样的功能,5秒自动跳,随便把浏览器怎么设置.
#6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim script As String
script = "<script language=javascript>"
script += "setTimeout('this.location.href=""testdt.aspx""',5000)"
script += "</script>"
If (Not Me.IsStartupScriptRegistered("test")) Then
Me.RegisterStartupScript("test", script)
End If
End Sub
Dim script As String
script = "<script language=javascript>"
script += "setTimeout('this.location.href=""testdt.aspx""',5000)"
script += "</script>"
If (Not Me.IsStartupScriptRegistered("test")) Then
Me.RegisterStartupScript("test", script)
End If
End Sub
#7
private void Button1_Click(object sender, System.EventArgs e)
{
string script;
script = "<script language=javascript>";
script += "setTimeout('this.location.href=\"testdt.aspx\"',5000)";
script += "</script>";
if ((!(this.IsStartupScriptRegistered("test")))) {
this.RegisterStartupScript("test", script);
}
}
{
string script;
script = "<script language=javascript>";
script += "setTimeout('this.location.href=\"testdt.aspx\"',5000)";
script += "</script>";
if ((!(this.IsStartupScriptRegistered("test")))) {
this.RegisterStartupScript("test", script);
}
}
#8
朋友,你这不是JS吗?楼上有位朋友说的是System.Threading Namespace
JS的话可以直接写啊,谢谢
JS的话可以直接写啊,谢谢
#9
mark
#10
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
这是MS的人写的例子,不知道他到底在做什么,没有看见redirect 功能.大家帮帮忙吧
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
这是MS的人写的例子,不知道他到底在做什么,没有看见redirect 功能.大家帮帮忙吧
#11
肯定是用的这个空间命名,但是不知道具体如何设置properties