急!!初学者请教,送40分。 你可以不用timer,用脚本settimeout("RedirectTo()",200)function redirectTo (){window.location='login.aspx' ;}登陆成功后再进入MDI主窗体这个不用说了吧,网上很多资料。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.hubce.edu.cn/jwc/jwc5/highjava/day3_2.htmlsetTimeout的第2个参数指定了在多少毫秒之后执行第1个参数。 一秒钟等于1000毫秒。所以如果你想让某事在秒钟之后发生你必须将第2个参数设置为3,000 毫秒。 你用System.Threading.Thread.Sleep( 2000 ) ;吧 哈哈,那shuaizhen(varchar Net) ( ) 信誉:100 好好把握啊! 你用过winform吗?因为主线程不可以后打开,关了主线程程序也结束了。 private void timer1_Tick(object sender, System.EventArgs e) { Form2 frm2=new Form2(); frm2.Show(); } 谁关闭了的?知识延时2秒http://community.csdn.net/Expert/topic/3366/3366149.xml?temp=.2600977 然后显示登陆界面,登陆成功才显示MDI主窗体 我没有怎么作过winform,瞎搞了一个.错了不要见笑form1代码:static void Main() { Application.Run(new Form1()); } private void timer1_Tick(object sender, System.EventArgs e) { timer1.Enabled=false;//2000 Form2 form2 =new Form2() ; form2.Show() ; this.Hide(); }form2代码:private void button1_Click(object sender, System.EventArgs e) { //验证逻辑 form3 _form3 = new form3() ; _form3 .Show() ; this.Hide(); }form3代码:private void gis_Closed(object sender, System.EventArgs e) { Application.Exit( ) ; } 而且你form3的代码是关闭整个程序的,不知道用在这什么意思 建立多线程,当时间走完后启动主线程应用程序,然后关闭子线程程序不就得了当然Main()调用主线程后调用子线程,呵呵有点绕口令了,千万别写错地方,不然什么都运行不了 我来教你吧,但这只是个假像!!!^_^Frm_Splash : 欢迎界面Frm_SysLogin : 登录界面Frm_Main : 主界面SysComParas.cs 系统公共参数类1. SysComParas.cs 代码:定义一个表态变量public static bool Logined = false;2. Frm_Main 代码: static void Main() { // 欢迎界面 ( new Frm_Splash() ).ShowDialog(); //登录窗体 ( new Frm_SysLogin() ).ShowDialog(); //验证 if( SysComParas.Logined ) { //启动主窗口 Application.Run( new FrmSysStruct() ); } else { Application.Exit(); }}3.Frm_Splash 窗体:及代码先在窗体上拉一个Timer 控件//窗体的Load事件private void Frm_Splash_Load(object sender, System.EventArgs e){ this.timer1.Enabled = true; this.timer1.Interval = 1000;}//timer1 的Tick事件int intTickCount = 0;private void timer1_Tick(object sender, System.EventArgs e){//延迟两秒 while( this.intTickCount < 2 ) { intTickCount ++; } this.Close();}4. Frm_SysLogin 代码;如果登录验证成功, SysComParas.Logined = true;否 , SysComParas.Logined = false;以上说明,我想问题可以解决了!!!呵。 没有写过winform,期待中ING,帮你UP 而且Timer控件本来就有属性控制循环了,不用自己再专门去写了。 直接在html文件头里加入<meta http-equiv="refresh[刷新-这里指定动作]" content="5[这里是时间];url=/article[这里是跳转的URL]"> 我的问题是Winform的,你一定没有看清吧,不过还是要谢谢你回答我 把这些代码if( SysComParas.Logined ) { //启动主窗口 Application.Run( new FrmSysStruct() ); } else { Application.Exit(); }换成//启动主窗口 Application.Run( new FrmSysStruct() );,试试,不可能不成功! int index=1;count=10;执行index=(index++) % count;后输出结果为何还是1 这个时间段的SQL语句该怎么写? ADO.NET实体数据模型+存储过程 DataAdapter.Update的问题,请各位帮帮忙,郁闷很长时间了(偶穷,请海涵)... 怎么样才能给按扭加快捷键?? 请教: DataTable 取值问题 如何在xml节点中定义自增长的标识 正则表达式筛选数据(C#) 用人体肢体动作控制机器人 求教最后字符串源码 怎么样让datagrid 有数据的时候显示,没数据的时候隐藏 如何从文件的全路径名中获取文件名(取除目录和扩展名)
setTimeout的第2个参数指定了在多少毫秒之后执行第1个参数。
一秒钟等于1000毫秒。所以如果你想让某事在秒钟之后发
生你必须将第2个参数设置为3,000 毫秒。
shuaizhen(varchar Net) ( ) 信誉:100
好好把握啊!
{
Form2 frm2=new Form2();
frm2.Show();
}
http://community.csdn.net/Expert/topic/3366/3366149.xml?temp=.2600977
错了不要见笑
form1代码:
static void Main()
{
Application.Run(new Form1());
} private void timer1_Tick(object sender, System.EventArgs e)
{
timer1.Enabled=false;//2000
Form2 form2 =new Form2() ;
form2.Show() ;
this.Hide();
}
form2代码:
private void button1_Click(object sender, System.EventArgs e)
{
//验证逻辑
form3 _form3 = new form3() ;
_form3 .Show() ;
this.Hide();
}
form3代码:
private void gis_Closed(object sender, System.EventArgs e)
{
Application.Exit( ) ;
}
当然Main()调用主线程后调用子线程,
呵呵有点绕口令了,千万别写错地方,不然什么都运行不了
^_^
Frm_Splash : 欢迎界面
Frm_SysLogin : 登录界面
Frm_Main : 主界面
SysComParas.cs 系统公共参数类1. SysComParas.cs 代码:
定义一个表态变量
public static bool Logined = false;
2. Frm_Main 代码:
static void Main()
{
// 欢迎界面
( new Frm_Splash() ).ShowDialog();
//登录窗体
( new Frm_SysLogin() ).ShowDialog();
//验证
if( SysComParas.Logined )
{
//启动主窗口
Application.Run( new FrmSysStruct() );
}
else
{
Application.Exit();
}
}
3.Frm_Splash 窗体:及代码
先在窗体上拉一个Timer 控件
//窗体的Load事件
private void Frm_Splash_Load(object sender, System.EventArgs e)
{
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
}//timer1 的Tick事件
int intTickCount = 0;
private void timer1_Tick(object sender, System.EventArgs e)
{//延迟两秒
while( this.intTickCount < 2 )
{
intTickCount ++;
}
this.Close();
}
4. Frm_SysLogin 代码;
如果登录验证成功,
SysComParas.Logined = true;
否 ,
SysComParas.Logined = false;以上说明,我想问题可以解决了!!!
呵。
if( SysComParas.Logined )
{
//启动主窗口
Application.Run( new FrmSysStruct() );
}
else
{
Application.Exit();
}
换成
//启动主窗口
Application.Run( new FrmSysStruct() );
,试试,不可能不成功!