277. g.setColor(new Color(20 + random.nextInt(110), 20 + random 278. 279. .nextInt(110), 20 + random.nextInt(110))); 280. 281. g.drawString(String.valueOf(itmp), 15 * i + 10, 16); 282. 283. } 284. 285. } 286. 287. HttpSession session = request.getSession(true); 288. 289. session.setAttribute("checkcode", sRand); 290. 291. g.dispose(); 292. 293. try { 294. 295. ImageIO.write(image, "JPEG", response.getOutputStream()); 296. 297. } catch (IOException e) { 298. 299. e.printStackTrace(); 300. 301. } 302. 303. } 304. 305. 306.} package csdn.dbshop.action;
import org.apache.struts2.ServletActionContext;
import csdn.dbshop.domain.Admin; import csdn.dbshop.domain.Member; import csdn.dbshop.service.BaseService; import csdn.dbshop.service.MemberService; import csdn.dbshop.service.impl.BaseServiceImpl; import csdn.dbshop.service.impl.MemberServiceImpl; import csdn.dbshop.util.Pagination; import csdn.dbshop.util.StringUtil;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class MemberAction extends BaseAction{ private BaseService baseService = new BaseServiceImpl(); private MemberService memberService = new MemberServiceImpl(); private String cuemail; private boolean cueflag; private Member member; private String acodet; private boolean cacodet; private String sRand = ""; private String acode; << 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页
|