private void validCode_Click(object sender, EventArgs e) { string response = getCheckCodeResponse(tbNum.Text, tbCode.Text); if (response != null) { string serverResponse = SocketHelper.sendRequest(response, SERVER_ADDR, SERVER_PORT); if (serverResponse != null) { MessageBox.Show("OK".Equals(getSubStr(serverResponse, "resCode='", "'")) ? "验证成功!" : "验证错误!服务器返回数据:" + serverResponse); } else { MessageBox.Show("程序出现错误,或者服务器响应错误!"); } } else { MessageBox.Show("你的手机号码或者验证码非法!"); } }
private void getCode_Click(object sender, EventArgs e) { string request = getCheckCodeRequest(tbNum.Text); if (request != null) { string response = SocketHelper.sendRequest(request, SERVER_ADDR, SERVER_PORT); if (response != null) { MessageBox.Show(response.IndexOf("sendSuccess='Y'") > 0 ? "短信验证码已经发送到你的手机,你需要在90秒内输入到验证码框然后发送" : "服务器未发送短信验证码,返回内容:" + response); } else { MessageBox.Show("程序出现错误,或者服务器响应错误!"); } } else { MessageBox.Show("手机号码长度错误"); } }