cmaedu.com
ajax异步刷新
cmaedu.cominput type="text" name="email" id="email" onchange="checkfunc(this.value)"
cmaedu.comjs脚本:
cmaedu.comfunction checkfunc(obj){
cmaedu.com var url = '/check.do?';
var args = obj;
$.getJSON(url,args,function(data){
if(data==" "){ //data为后台传来的响应数据(自定义),局逻辑判断具体值
alert("邮箱已经被注册!");
action类:省(太复杂,吃饭了)
要去数据库里查,先要写连接数据库方法,不同数据库用有不同的连接方式,连接上了再查就简单了
cmaedu.com
cmaedu.comhi:你好:
你这道题目只要涉及到字符串的操作;重点关注下String类中的一些方法,下面是我帮你实现的代码样例,请参考:
cmaedu.com// 字符串判断,邮箱地址
class MailRun implements Runnable {
cmaedu.com private Scanner scanner;
private String Mail;
cmaedu.com public void setMail(String Mail) {
cmaedu.com this.Mail = Mail;
cmaedu.com public String getMail() {
cmaedu.com return Mail;
cmaedu.com public void run() {
cmaedu.com try {
System.out.println("请输入...");
cmaedu.com scanner = new Scanner(System.in);
cmaedu.com this.setMail(scanner.nextLine());
// System.out.println(this.getMail());
cmaedu.com String com = ".com";
String cn = ".cn";
String net = ".net";
String org = ".org";
cmaedu.com // System.out.println(this.getMail().substring(this.getMail().length()-4,
cmaedu.com // this.getMail().length()));
cmaedu.com String str1 = "@";
String str2 = ".";
int a = 0;
int b = 0;
// System.out.println(this.getMail().indexOf(str1));
cmaedu.com // 当有“@”时才输出,indexOf!=-1
int Counta = this.getMail().indexOf("@");
cmaedu.com int Countb = this.getMail().indexOf(".");
// 判断必须包含@ 至少有一个. @的位置在.的前面
cmaedu.com if ((this.getMail().indexOf(str1) != -1) (this.getMail().indexOf(str2) != -1) (Counta Countb)) {
// 判断只有一个@
cmaedu.com while (this.getMail().indexOf(str1, b) = 0 b this.getMail().length()) {
a++;
cmaedu.com b = this.getMail().indexOf(str1, b) + str1.length();
cmaedu.com // @的出现次数必须小于2
if (a 2) {
cmaedu.com // System.out.println(this.getMail());
// @与.之间存在字符
if ((this.getMail().indexOf(str2) - this.getMail().indexOf(str1)) 2) {
cmaedu.com // 用户地址长度,不能超过150个文字
cmaedu.com if (this.getMail().indexOf(str1) = 150 this.getMail().indexOf(str1) 0) {
cmaedu.com // 地址最后为.com
if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(com)) {
System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.cn
cmaedu.com } else if (this.getMail().substring(this.getMail().length() - 3, this.getMail().length())
.equals(cn)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.net
cmaedu.com } else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
cmaedu.com .equals(net)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
cmaedu.com // 地址最后为.org
} else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(org)) {
cmaedu.com System.out.println("邮箱为:" + this.getMail());
} else {
cmaedu.com System.out.println("邮箱后缀不正确!");
} else {
cmaedu.com System.out.println("用户名称,字符最长不能超出150个字符,字符最短不能小于1个字符");
} else {
cmaedu.com System.out.println("请检查域名,@与.之间存在字符!");
} else {
System.out.println("请检查是否重复输入@");
cmaedu.com } else {
cmaedu.com System.out.println("请检查是否包含@ 和 . ;同时检查@是否在.的前面");
} catch (Exception e) {
e.printStackTrace();
cmaedu.com需要下载电子邮箱。
cmaedu.com打开电子邮箱,点击注册Xbox Live。他会发信息到你手机 , 输入验证码你就可以设置密码 ,然后注册完成 再关联你的电子邮箱就可以了。
电子邮件是—种用电子手段提供信息交换的通信方式,是互联网应用最广的服务。通过网络的电子邮件系统,用户可以以非常低廉的价格(不管发送到哪里,都只需负担网费)、非常快速的方式(几秒钟之内可以发送到世界上任何指定的目的地),与世界上任何一个角落的网络用户联系。
cmaedu.com
js邮箱验证
cmaedu.comscript. type="text/javascript"
function checkemail()
cmaedu.com var temp = document.getElementById("email");
var myreg = /(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
cmaedu.com if(temp.value!="")
cmaedu.com if(!myreg.test(temp.value))
cmaedu.com document.getElementById("mail").innerHTML="请输入有效的email!";
document.getElementById("mail").style.color="red";
temp.value="";
cmaedu.com temp.focus();
return false;
else{
cmaedu.com document.getElementById("mail").innerHTML="email可以使用";
cmaedu.com document.getElementById("mail").style.color="green";
/script
html如下:
cmaedu.com这里我只写在body里面的代码:
邮箱地址:input id="email" name="email" nBlur="checkemail()" type="text" /span id="mail"/span br
cmaedu.combr
cmaedu.com js文件名验证 你得定义是什么样的文件 txt doc还是其他
用软件破解自己被盗的邮箱或其他密码违法吗?200分! 先不说犯法不犯法的事,你现在要破解主流的服务器的邮箱和你破解QQ密码一样困难!如果真是自己的QQ可以通过申诉找回来的破解个QQ密码或者是邮箱密码,...
怎样发送电子邮件到别人邮箱里 步骤一:首先自己要有一个邮箱,登录进入TOM企业邮箱,在邮箱首页左上方点击“写邮件”按钮,在右侧可以看到联系人列表,点击要收邮件的人员,将会添加到手机人地址栏中,就不用一...
求一推理故事 侦探维力斯一觉醒来,已经后半夜两点多了。他烧了一 杯咖啡,刚要喝,电话铃响了。 "哈罗!他问道,"哪里?" "我是利马公寓。侦探先生,我们这里发生了一起抢劫 案!" "我马上到!"维力斯...
在网络里菜鸟,大虾之类的词都是什么意思啊? 菜鸟(网络词汇):某个人刚刚加入某个团队,或某个组织刚刚进入某个行业,适应环境、接受新的事物,都是需要一个过程的,处在这个过程阶段的人或组织,就叫菜鸟。大虾...
蛋仔网易邮箱号如何清除实名 1、方法如下:首先打开蛋仔派对这款游戏,登录账号面,进入主界面。其次点击设置,点击账号安全。最后在账号安全界面,点击实名认证,即可解除实名认证。2、蛋仔派对渠道服要清实名,...
申请加拿大留学,跟催学校通知书的电子邮件怎么写 申请加拿大学校一般都会有一个申请号,例如STUDENT ID或者APPLICATION ID或者REFERENCE NUMBER这种。邮件主题写自己名字...