private String getCaptcha() { GeetestLib geetest = new GeetestLib(GeetestConfig.publicKey, GeetestConfig.privateKey); String userID = "test"; Byte gtServerStatus = geetest.preProcess(userID); Session[GeetestLib.gtServerStatusSessionKey] = gtServerStatus; Session["userID"] = userID; return geetest.getResponseStr(); }
private String getCaptcha() { GeetestLib geetest = new GeetestLib(GeetestConfig.privateKey, GeetestConfig.publicKey); String resStr = ""; if (geetest.preProcess()) { resStr = geetest.getSuccessPreProcessRes(); geetest.setGtServerStatusSession(Session, 1); } else { resStr = geetest.getFailPreProcessRes(); geetest.setGtServerStatusSession(Session, 0); } return resStr; }