⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkcode.java.svn-base

📁 用JSP JAVA 做的 系统 只是初来扎到还望西黄!别乱来哦!
💻 SVN-BASE
字号:
/**
 * Copyright (c) 2005-2008 KIND Corp. 2005-2008,All Rights Reserved.
 * This software is published under the KIND Team.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @File name:  NoUseCAKeyLogon.java
 * @Description:   
 * @Create on:  2008-3-22
 * @Author   :  st
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 *
 */

package com.chis.model.frame;

import java.util.Random;
import com.stframe.form.ActionForm;
import com.stframe.servlet.ActionInstance;

public class CheckCode extends ActionInstance{	
	public int execute(ActionForm af) throws Exception {		 
		 Random random = new Random();
		 String rand =String.valueOf(random.nextInt(9999));
		 
		switch(rand.length()) 
		{	
			case 1: rand = "000"+rand; break; 
			case 2: rand = "00"+rand; break; 
			case 3: rand = "0"+rand; break; 
			default: rand = rand.substring(0,4); break; 
		} 
		
		 af.getHttpSession().setAttribute("CheckCode", rand );
		 return 1;
		}
	 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -