26 26 {
27 27 strReturnCode = "0";
28 28 }
29 29 CallBackHelper.Write(strReturnCode);
30 30 }
31 31 catch (Exception ex)
32 32 {
33 33 CallBackHelper.HandleError(ex);
34 34 }
35 35 }
36 36 private bool IsUsernameExist(string strUsername)
37 37 {
38 38 bool bRet = false;
39 39
40 40 switch (strUsername.ToUpper())
41 41 {
42 42 case "KING":
43 43 case "ROSE":
44 44 bRet = true;
45 45 break;
46 46 }
47 47
48 48 return bRet;
49 49 }
50 50
51 51 private bool IsValidUsername(string strUsername)
52 52 {
53 53 return (Regex.IsMatch(strUsername, @"^(w{3,15})$"));
54 54 }
55 55}
3. Ajax主要的JS文件代码如下:
1 1 // JScript File
2 2 function CallBackObject()
3 3 {
4 4 this.XmlHttp = this.GetHttpObject();
5 5 }
6 6 CallBackObject.prototype.GetHttpObject = function()
7 7 {
8 8 var xmlhttp;
9 9 /*@cc_on
10 10 @if (@_jscript_version >= 5)
11 11 try {
12 12 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
13 13 } catch (e) {

