本文介绍了如何在代码隐藏功能中执行PAUSE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我希望暂停一个功能,然后在30秒内恢复。 我知道这听起来很奇怪...我有一种情况需要写一个cookie, 但是用户在asp.net页面加载时没有权限驱动,并且我认为这会阻止cookie被写入。我需要 代码暂停,然后在30秒内写下cookie ..... 任何人都知道是否可以这样做? TY jason shohet 解决方案 我相信你可以通过获取当前线程的引用 来满足您的请求并让它睡眠: System.Threading.Thread.Current.Sleep(30 * 1000); 我很确定arg是毫秒,请验证。 - Craig Deelsnyder Microsoft MVP - ASP / ASP.NET I want a function to pause, then resume in 30 seconds.I know it sounds wierd... I have a situation that I need to write a cookie,but the user does not have rights to drive at the time the asp.net pageloads, and I think this is preventing the cookie from being written. I needthe code to pause, then in 30 seconds write the cookie.....anyone know if this can be done?TYjason shohet 解决方案I believe you can do this by getting a reference to the current threadfor your request and have it sleep:System.Threading.Thread.Current.Sleep(30 * 1000);I''m pretty sure that arg is milliseconds, please verify.--Craig DeelsnyderMicrosoft MVP - ASP/ASP.NET 这篇关于如何在代码隐藏功能中执行PAUSE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-12 07:20