├── Code ├── App_Code │ ├── Comman │ │ ├── MD5Encrypt.cs │ │ ├── SetCookie.cs │ │ ├── dateConversion.cs │ │ ├── settings.cs │ │ └── writeHtml.cs │ ├── DAL │ │ ├── cuotiDAL.cs │ │ ├── kaoshiDAL.cs │ │ ├── optionsDAL.cs │ │ ├── questionDAL.cs │ │ └── yonghuDAL.cs │ ├── DBUtility │ │ ├── CommandInfo.cs │ │ ├── DESEncrypt.cs │ │ ├── DbHelperSQL.cs │ │ └── PubConstant.cs │ └── Model │ │ ├── cuotiModel.cs │ │ ├── kaoshiModel.cs │ │ ├── optionsModel.cs │ │ ├── questionModel.cs │ │ └── yonghuModel.cs ├── App_Data │ ├── InformationSecurity.mdf │ ├── InformationSecurity_log.ldf │ ├── sql.sql │ └── 题库.xls ├── Bin │ ├── NVelocity.dll │ └── NVelocity.dll.refresh ├── account │ ├── VerifyCode.ashx │ ├── login.aspx │ ├── login.aspx.cs │ ├── register.ashx │ ├── register.aspx │ ├── register.aspx.cs │ ├── signout.aspx │ └── signout.aspx.cs ├── css │ ├── account │ │ ├── login.css │ │ └── register.css │ ├── default.css │ ├── kaoshi.css │ ├── lianxi.css │ ├── loading.css │ └── main.css ├── cuoti.aspx ├── cuoti.aspx.cs ├── default.aspx ├── default.aspx.cs ├── images │ ├── 1.jpg │ ├── accounts │ │ ├── checkbox_login_0.png │ │ ├── checkbox_login_1.png │ │ ├── glb.png │ │ ├── login_bg.jpg │ │ └── password_safe.png │ ├── background.jpg │ ├── bg.jpg │ ├── checkbox_login_0.png │ ├── checkbox_login_1.png │ ├── currentbg.png │ ├── header.jpg │ ├── ico │ │ ├── cuowu.png │ │ ├── emoticon_in_love.png │ │ ├── kaoshi.png │ │ ├── kaoshijilu.png │ │ ├── shoucang.png │ │ ├── shoucang1.png │ │ ├── shunxu.png │ │ └── suiji.png │ ├── inform-ico.png │ ├── list-top.png │ ├── logo.png │ ├── 判断.PNG │ ├── 单选.PNG │ └── 多选.PNG ├── jiaojuan.aspx ├── jiaojuan.aspx.cs ├── js │ ├── ajax.js │ ├── ceshi.js │ ├── common.js │ ├── jquery-1.7.2.js │ ├── jquery.cookie.js │ ├── lianxi.js │ ├── popwin.js │ └── register.js ├── kaoshi.ashx ├── kaoshi.aspx ├── kaoshi.aspx.cs ├── lianxi.aspx ├── lianxi.aspx.cs └── web.config ├── README.md └── README ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png ├── 06.png ├── 07.png └── 08.png /Code/App_Code/Comman/MD5Encrypt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Configuration; 6 | using System.Security.Cryptography; 7 | 8 | namespace Commom 9 | { 10 | public class MD5Encrypt 11 | { 12 | public string GetMD5(string sDataIn) 13 | { 14 | MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); 15 | byte[] bytValue, bytHash; 16 | bytValue = System.Text.Encoding.UTF8.GetBytes(sDataIn); 17 | bytHash = md5.ComputeHash(bytValue); 18 | md5.Clear(); 19 | string sTemp = ""; 20 | for (int i = 0; i < bytHash.Length; i++) 21 | { 22 | sTemp += bytHash[i].ToString("X").PadLeft(2, '0'); 23 | } 24 | return sTemp.ToLower(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Code/App_Code/Comman/SetCookie.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using DAL; 6 | using Model; 7 | 8 | namespace Commom 9 | { 10 | public class SetCookie 11 | { 12 | /// 创建Cookie 13 | /// 14 | /// Cookie名称 15 | /// Cookie时间中的天数 16 | /// Cookie时间中的时 17 | /// Cookie时间中的分 18 | /// Cookie时间中的秒 19 | /// 数据 二维数组(定义方法:string[,] array = new string[3,2]) 20 | public void CreateCookie(string cookieName, int d, int h, int m, int s, string[,] array) 21 | { 22 | HttpCookie cookie = new HttpCookie(cookieName); 23 | TimeSpan ts = new TimeSpan(d, h, m, s);//天 时 分 秒 24 | DateTime dt = DateTime.Now; 25 | cookie.Expires = dt.Add(ts); 26 | for (int i = 0; i < array.GetLength(0); i++) 27 | { 28 | cookie[array[i, 0]] = array[i, 1]; 29 | } 30 | HttpContext.Current.Response.AppendCookie(cookie); 31 | } 32 | 33 | 34 | 35 | /// 36 | /// 判断是否在线 37 | /// 38 | /// 39 | public string WhetherOnline() 40 | { 41 | string userid = null; 42 | HttpCookie cookies = HttpContext.Current.Request.Cookies["ISAccountCookie"]; 43 | if (cookies != null) 44 | { 45 | string uname = cookies["username"].ToString(); 46 | string upwd = cookies["userpwd"].ToString(); 47 | string isAutoLogin = cookies["isAutoLogin"].ToString(); 48 | int uright = int.Parse(cookies["uright"].ToString()); 49 | string uid = cookies["uid"].ToString(); 50 | yonghuModel yhm = new yonghuDAL().GetModelByUsername(uname); 51 | 52 | #region 验证是否该用户 作用:防止黑客通过Cookie入侵 53 | string uid2 = new MD5Encrypt().GetMD5(yhm.nvc_username + yhm.nc_uid); 54 | if (uid == uid2 && uright == yhm.int_right) 55 | { 56 | #region 验证密码 57 | string pwd2 = new MD5Encrypt().GetMD5(upwd + yhm.nvc_username); 58 | if (pwd2 == yhm.nvc_pwd) 59 | { 60 | userid = yhm.nc_uid; 61 | } 62 | else 63 | { 64 | HttpContext.Current.Response.Write(""); 65 | } 66 | #endregion 67 | } 68 | else 69 | { 70 | HttpContext.Current.Response.Write(""); 71 | } 72 | #endregion 73 | } 74 | else 75 | { 76 | HttpContext.Current.Response.Write(""); 77 | } 78 | return userid; 79 | } 80 | 81 | } 82 | } -------------------------------------------------------------------------------- /Code/App_Code/Comman/dateConversion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Data; 6 | 7 | namespace Commom 8 | { 9 | public class dateConversion 10 | { 11 | public DataSet getTihaoData(DataSet ds) 12 | { 13 | DataSet newds = new DataSet(); 14 | DataTable dt = new DataTable(); 15 | //为dt中增加列 16 | for (int i = 1; i <= 25; i++) 17 | { 18 | dt.Columns.Add("tihao" + i, typeof(string));//ID 19 | dt.Columns.Add("timuId" + i, typeof(string));//操作者 20 | } 21 | 22 | int totalNum = ds.Tables[0].Rows.Count;//总记录数 23 | int newRowsNum = 0;//新行数 24 | if ((totalNum % 25) > 0) 25 | { 26 | newRowsNum = (totalNum / 25) + 1; 27 | } 28 | else 29 | { 30 | newRowsNum = totalNum / 25; 31 | } 32 | 33 | for (int m = 0; m < newRowsNum; m++) 34 | { 35 | DataRow dr = dt.NewRow();//增加行 36 | if (m == newRowsNum - 1) 37 | { 38 | for (int n = 25 * m; n < totalNum; n++) 39 | { 40 | int nid = (n % 25) + 1; 41 | dr["tihao" + nid] = n + 1; 42 | dr["timuId" + nid] = ds.Tables[0].Rows[n]["nc_qid"].ToString(); 43 | } 44 | } 45 | if (m < newRowsNum - 1) 46 | { 47 | for (int n = 25 * m; n < 25 * (m + 1); n++) 48 | { 49 | int nid = (n % 25) + 1; 50 | dr["tihao" + nid] = n + 1; 51 | dr["timuId" + nid] = ds.Tables[0].Rows[n]["nc_qid"].ToString(); 52 | } 53 | } 54 | dt.Rows.Add(dr); 55 | } 56 | newds.Tables.Add(dt); 57 | return newds; 58 | } 59 | 60 | 61 | 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /Code/App_Code/Comman/settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Commom 7 | { 8 | public class settings 9 | { 10 | public string getdomain() 11 | { 12 | string domain = "http://127.0.0.1:82"; 13 | return domain; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Code/App_Code/Comman/writeHtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using NVelocity.App; 6 | using NVelocity.Runtime; 7 | using NVelocity; 8 | 9 | namespace Commom 10 | { 11 | public class writeHtml 12 | { 13 | public static string readerHtml(string path, string name, object data) 14 | { 15 | VelocityEngine vltEngine = new VelocityEngine(); 16 | vltEngine.SetProperty(RuntimeConstants.RESOURCE_LOADER, "file"); 17 | vltEngine.SetProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, System.Web.Hosting.HostingEnvironment.MapPath(path));//模板文件所在的文件夹 18 | vltEngine.Init(); 19 | 20 | VelocityContext vltContext = new VelocityContext(); 21 | vltContext.Put("Data", data);//设置参数,在模板中可以通过$data来引用 22 | 23 | Template vltTemplate = vltEngine.GetTemplate(name); 24 | System.IO.StringWriter vltWriter = new System.IO.StringWriter(); 25 | vltTemplate.Merge(vltContext, vltWriter); 26 | return vltWriter.GetStringBuilder().ToString(); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Code/App_Code/DAL/cuotiDAL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | using DBUtility; 6 | using Model;//Please add references 7 | namespace DAL 8 | { 9 | /// 10 | /// 数据访问类:cuoti 11 | /// 12 | public partial class cuotiDAL 13 | { 14 | public cuotiDAL() 15 | {} 16 | #region BasicMethod 17 | 18 | /// 19 | /// 是否存在该记录 20 | /// 21 | public bool Exists(string nc_ctid) 22 | { 23 | StringBuilder strSql=new StringBuilder(); 24 | strSql.Append("select count(1) from cuoti"); 25 | strSql.Append(" where nc_ctid=@nc_ctid "); 26 | SqlParameter[] parameters = { 27 | new SqlParameter("@nc_ctid", SqlDbType.NChar,20) }; 28 | parameters[0].Value = nc_ctid; 29 | 30 | return DbHelperSQL.Exists(strSql.ToString(),parameters); 31 | } 32 | 33 | 34 | /// 35 | /// 增加一条数据 36 | /// 37 | public bool Add(cuotiModel model) 38 | { 39 | StringBuilder strSql=new StringBuilder(); 40 | strSql.Append("insert into cuoti("); 41 | strSql.Append("nc_qid,nc_uid)"); 42 | strSql.Append(" values ("); 43 | strSql.Append("@nc_qid,@nc_uid)"); 44 | SqlParameter[] parameters = { 45 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 46 | new SqlParameter("@nc_uid", SqlDbType.NChar,20)}; 47 | parameters[0].Value = model.nc_qid; 48 | parameters[1].Value = model.nc_uid; 49 | 50 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 51 | if (rows > 0) 52 | { 53 | return true; 54 | } 55 | else 56 | { 57 | return false; 58 | } 59 | } 60 | /// 61 | /// 更新一条数据 62 | /// 63 | public bool Update(cuotiModel model) 64 | { 65 | StringBuilder strSql=new StringBuilder(); 66 | strSql.Append("update cuoti set "); 67 | strSql.Append("nc_qid=@nc_qid,"); 68 | strSql.Append("nc_uid=@nc_uid"); 69 | strSql.Append(" where nc_ctid=@nc_ctid "); 70 | SqlParameter[] parameters = { 71 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 72 | new SqlParameter("@nc_uid", SqlDbType.NChar,20), 73 | new SqlParameter("@nc_ctid", SqlDbType.NChar,20)}; 74 | parameters[0].Value = model.nc_qid; 75 | parameters[1].Value = model.nc_uid; 76 | parameters[2].Value = model.nc_ctid; 77 | 78 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 79 | if (rows > 0) 80 | { 81 | return true; 82 | } 83 | else 84 | { 85 | return false; 86 | } 87 | } 88 | 89 | /// 90 | /// 删除一条数据 91 | /// 92 | public bool Delete(string nc_ctid) 93 | { 94 | 95 | StringBuilder strSql=new StringBuilder(); 96 | strSql.Append("delete from cuoti "); 97 | strSql.Append(" where nc_ctid=@nc_ctid "); 98 | SqlParameter[] parameters = { 99 | new SqlParameter("@nc_ctid", SqlDbType.NChar,20) }; 100 | parameters[0].Value = nc_ctid; 101 | 102 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 103 | if (rows > 0) 104 | { 105 | return true; 106 | } 107 | else 108 | { 109 | return false; 110 | } 111 | } 112 | /// 113 | /// 批量删除数据 114 | /// 115 | public bool DeleteList(string nc_ctidlist ) 116 | { 117 | StringBuilder strSql=new StringBuilder(); 118 | strSql.Append("delete from cuoti "); 119 | strSql.Append(" where nc_ctid in ("+nc_ctidlist + ") "); 120 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 121 | if (rows > 0) 122 | { 123 | return true; 124 | } 125 | else 126 | { 127 | return false; 128 | } 129 | } 130 | 131 | 132 | /// 133 | /// 得到一个对象实体 134 | /// 135 | public cuotiModel GetModel(string nc_ctid) 136 | { 137 | 138 | StringBuilder strSql=new StringBuilder(); 139 | strSql.Append("select top 1 nc_ctid,nc_qid,nc_uid from cuoti "); 140 | strSql.Append(" where nc_ctid=@nc_ctid "); 141 | SqlParameter[] parameters = { 142 | new SqlParameter("@nc_ctid", SqlDbType.NChar,20) }; 143 | parameters[0].Value = nc_ctid; 144 | 145 | cuotiModel model=new cuotiModel(); 146 | DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 147 | if(ds.Tables[0].Rows.Count>0) 148 | { 149 | return DataRowToModel(ds.Tables[0].Rows[0]); 150 | } 151 | else 152 | { 153 | return null; 154 | } 155 | } 156 | 157 | 158 | /// 159 | /// 得到一个对象实体 160 | /// 161 | public cuotiModel DataRowToModel(DataRow row) 162 | { 163 | cuotiModel model=new cuotiModel(); 164 | if (row != null) 165 | { 166 | if(row["nc_ctid"]!=null) 167 | { 168 | model.nc_ctid=row["nc_ctid"].ToString(); 169 | } 170 | if(row["nc_qid"]!=null) 171 | { 172 | model.nc_qid=row["nc_qid"].ToString(); 173 | } 174 | if(row["nc_uid"]!=null) 175 | { 176 | model.nc_uid=row["nc_uid"].ToString(); 177 | } 178 | } 179 | return model; 180 | } 181 | 182 | /// 183 | /// 获得数据列表 184 | /// 185 | public DataSet GetList(string strWhere) 186 | { 187 | StringBuilder strSql=new StringBuilder(); 188 | strSql.Append("select distinct nc_qid "); 189 | strSql.Append(" FROM cuoti "); 190 | if(strWhere.Trim()!="") 191 | { 192 | strSql.Append(" where "+strWhere); 193 | } 194 | return DbHelperSQL.Query(strSql.ToString()); 195 | } 196 | 197 | /// 198 | /// 获得前几行数据 199 | /// 200 | public DataSet GetList(int Top,string strWhere,string filedOrder) 201 | { 202 | StringBuilder strSql=new StringBuilder(); 203 | strSql.Append("select "); 204 | if(Top>0) 205 | { 206 | strSql.Append(" top "+Top.ToString()); 207 | } 208 | strSql.Append(" nc_ctid,nc_qid,nc_uid "); 209 | strSql.Append(" FROM cuoti "); 210 | if(strWhere.Trim()!="") 211 | { 212 | strSql.Append(" where "+strWhere); 213 | } 214 | strSql.Append(" order by " + filedOrder); 215 | return DbHelperSQL.Query(strSql.ToString()); 216 | } 217 | 218 | /// 219 | /// 获取记录总数 220 | /// 221 | public int GetRecordCount(string strWhere) 222 | { 223 | StringBuilder strSql=new StringBuilder(); 224 | strSql.Append("select count(1) FROM cuoti "); 225 | if(strWhere.Trim()!="") 226 | { 227 | strSql.Append(" where "+strWhere); 228 | } 229 | object obj = DbHelperSQL.GetSingle(strSql.ToString()); 230 | if (obj == null) 231 | { 232 | return 0; 233 | } 234 | else 235 | { 236 | return Convert.ToInt32(obj); 237 | } 238 | } 239 | /// 240 | /// 分页获取数据列表 241 | /// 242 | public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 243 | { 244 | StringBuilder strSql=new StringBuilder(); 245 | strSql.Append("SELECT * FROM ( "); 246 | strSql.Append(" SELECT ROW_NUMBER() OVER ("); 247 | if (!string.IsNullOrEmpty(orderby.Trim())) 248 | { 249 | strSql.Append("order by T." + orderby ); 250 | } 251 | else 252 | { 253 | strSql.Append("order by T.nc_ctid desc"); 254 | } 255 | strSql.Append(")AS Row, T.* from cuoti T "); 256 | if (!string.IsNullOrEmpty(strWhere.Trim())) 257 | { 258 | strSql.Append(" WHERE " + strWhere); 259 | } 260 | strSql.Append(" ) TT"); 261 | strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); 262 | return DbHelperSQL.Query(strSql.ToString()); 263 | } 264 | 265 | /* 266 | /// 267 | /// 分页获取数据列表 268 | /// 269 | public DataSet GetList(int PageSize,int PageIndex,string strWhere) 270 | { 271 | SqlParameter[] parameters = { 272 | new SqlParameter("@tblName", SqlDbType.VarChar, 255), 273 | new SqlParameter("@fldName", SqlDbType.VarChar, 255), 274 | new SqlParameter("@PageSize", SqlDbType.Int), 275 | new SqlParameter("@PageIndex", SqlDbType.Int), 276 | new SqlParameter("@IsReCount", SqlDbType.Bit), 277 | new SqlParameter("@OrderType", SqlDbType.Bit), 278 | new SqlParameter("@strWhere", SqlDbType.VarChar,1000), 279 | }; 280 | parameters[0].Value = "cuoti"; 281 | parameters[1].Value = "nc_ctid"; 282 | parameters[2].Value = PageSize; 283 | parameters[3].Value = PageIndex; 284 | parameters[4].Value = 0; 285 | parameters[5].Value = 0; 286 | parameters[6].Value = strWhere; 287 | return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); 288 | }*/ 289 | 290 | #endregion BasicMethod 291 | #region ExtensionMethod 292 | 293 | #endregion ExtensionMethod 294 | } 295 | } 296 | 297 | -------------------------------------------------------------------------------- /Code/App_Code/DAL/kaoshiDAL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | using DBUtility; 6 | using Model;//Please add references 7 | namespace DAL 8 | { 9 | /// 10 | /// 数据访问类:kaoshi 11 | /// 12 | public partial class kaoshiDAL 13 | { 14 | public kaoshiDAL() 15 | { } 16 | #region BasicMethod 17 | 18 | /// 19 | /// 是否存在该记录 20 | /// 21 | public bool Exists(string nc_id) 22 | { 23 | StringBuilder strSql = new StringBuilder(); 24 | strSql.Append("select count(1) from kaoshi"); 25 | strSql.Append(" where nc_id=@nc_id "); 26 | SqlParameter[] parameters = { 27 | new SqlParameter("@nc_id", SqlDbType.NChar,20) }; 28 | parameters[0].Value = nc_id; 29 | 30 | return DbHelperSQL.Exists(strSql.ToString(), parameters); 31 | } 32 | 33 | 34 | /// 35 | /// 增加一条数据 36 | /// 37 | public bool Add(kaoshiModel model) 38 | { 39 | StringBuilder strSql = new StringBuilder(); 40 | strSql.Append("insert into kaoshi("); 41 | strSql.Append("nc_kaoshiId,nc_qid,nc_daanid,bit_isRight,nc_uid)"); 42 | strSql.Append(" values ("); 43 | strSql.Append("@nc_kaoshiId,@nc_qid,@nc_daanid,@bit_isRight,@nc_uid)"); 44 | SqlParameter[] parameters = { 45 | new SqlParameter("@nc_kaoshiId", SqlDbType.NChar,18), 46 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 47 | new SqlParameter("@nc_daanid", SqlDbType.NChar,12), 48 | new SqlParameter("@bit_isRight", SqlDbType.Bit,1), 49 | new SqlParameter("@nc_uid", SqlDbType.NChar,20)}; 50 | parameters[0].Value = model.nc_kaoshiId; 51 | parameters[1].Value = model.nc_qid; 52 | parameters[2].Value = model.nc_daanid; 53 | parameters[3].Value = model.bit_isRight; 54 | parameters[4].Value = model.nc_uid; 55 | 56 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); 57 | if (rows > 0) 58 | { 59 | return true; 60 | } 61 | else 62 | { 63 | return false; 64 | } 65 | } 66 | 67 | /// 68 | /// 修改成绩 69 | /// 70 | public bool UpDateChengji(string nc_kaoshiId, string nvc_chengji) 71 | { 72 | StringBuilder strSql = new StringBuilder(); 73 | strSql.Append("upDate kaoshi set "); 74 | strSql.Append("nvc_chengji=@nvc_chengji "); 75 | strSql.Append(" where nc_kaoshiId=@nc_kaoshiId "); 76 | SqlParameter[] parameters = { 77 | new SqlParameter("@nc_kaoshiId", SqlDbType.NChar,18), 78 | new SqlParameter("@nvc_chengji", SqlDbType.NVarChar,50)}; 79 | parameters[0].Value = nc_kaoshiId; 80 | parameters[1].Value = nvc_chengji; 81 | 82 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); 83 | if (rows > 0) 84 | { 85 | return true; 86 | } 87 | else 88 | { 89 | return false; 90 | } 91 | } 92 | 93 | /// 94 | /// 修改考试时间 95 | /// 96 | public bool UpDateShijian(string nc_kaoshiId) 97 | { 98 | StringBuilder strSql = new StringBuilder(); 99 | strSql.Append("upDate kaoshi set "); 100 | strSql.Append("dt_shijian=getdate() "); 101 | strSql.Append(" where nc_kaoshiId=@nc_kaoshiId "); 102 | SqlParameter[] parameters = { 103 | new SqlParameter("@nc_kaoshiId", SqlDbType.NChar,18)}; 104 | parameters[0].Value = nc_kaoshiId; 105 | 106 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); 107 | if (rows > 0) 108 | { 109 | return true; 110 | } 111 | else 112 | { 113 | return false; 114 | } 115 | } 116 | 117 | /// 118 | /// 更新一条数据 119 | /// 120 | public bool Update(kaoshiModel model) 121 | { 122 | StringBuilder strSql = new StringBuilder(); 123 | strSql.Append("update kaoshi set "); 124 | strSql.Append("nc_kaoshiId=@nc_kaoshiId,"); 125 | strSql.Append("nc_qid=@nc_qid,"); 126 | strSql.Append("nc_daanid=@nc_daanid,"); 127 | strSql.Append("bit_isRight=@bit_isRight,"); 128 | strSql.Append("nvc_chengji=@nvc_chengji,"); 129 | strSql.Append("dt_shijian=@dt_shijian,"); 130 | strSql.Append("nc_uid=@nc_uid"); 131 | strSql.Append(" where nc_id=@nc_id "); 132 | SqlParameter[] parameters = { 133 | new SqlParameter("@nc_kaoshiId", SqlDbType.NChar,18), 134 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 135 | new SqlParameter("@nc_daanid", SqlDbType.NChar,12), 136 | new SqlParameter("@bit_isRight", SqlDbType.Bit,1), 137 | new SqlParameter("@nvc_chengji", SqlDbType.NVarChar,50), 138 | new SqlParameter("@dt_shijian", SqlDbType.DateTime), 139 | new SqlParameter("@nc_uid", SqlDbType.NChar,20), 140 | new SqlParameter("@nc_id", SqlDbType.NChar,20)}; 141 | parameters[0].Value = model.nc_kaoshiId; 142 | parameters[1].Value = model.nc_qid; 143 | parameters[2].Value = model.nc_daanid; 144 | parameters[3].Value = model.bit_isRight; 145 | parameters[4].Value = model.nvc_chengji; 146 | parameters[5].Value = model.dt_shijian; 147 | parameters[6].Value = model.nc_uid; 148 | parameters[7].Value = model.nc_id; 149 | 150 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); 151 | if (rows > 0) 152 | { 153 | return true; 154 | } 155 | else 156 | { 157 | return false; 158 | } 159 | } 160 | 161 | /// 162 | /// 删除一条数据 163 | /// 164 | public bool Delete(string nc_id) 165 | { 166 | 167 | StringBuilder strSql = new StringBuilder(); 168 | strSql.Append("delete from kaoshi "); 169 | strSql.Append(" where nc_id=@nc_id "); 170 | SqlParameter[] parameters = { 171 | new SqlParameter("@nc_id", SqlDbType.NChar,20) }; 172 | parameters[0].Value = nc_id; 173 | 174 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); 175 | if (rows > 0) 176 | { 177 | return true; 178 | } 179 | else 180 | { 181 | return false; 182 | } 183 | } 184 | /// 185 | /// 批量删除数据 186 | /// 187 | public bool DeleteList(string nc_idlist) 188 | { 189 | StringBuilder strSql = new StringBuilder(); 190 | strSql.Append("delete from kaoshi "); 191 | strSql.Append(" where nc_id in (" + nc_idlist + ") "); 192 | int rows = DbHelperSQL.ExecuteSql(strSql.ToString()); 193 | if (rows > 0) 194 | { 195 | return true; 196 | } 197 | else 198 | { 199 | return false; 200 | } 201 | } 202 | 203 | 204 | /// 205 | /// 得到一个对象实体 206 | /// 207 | public kaoshiModel GetModel(string nc_id) 208 | { 209 | 210 | StringBuilder strSql = new StringBuilder(); 211 | strSql.Append("select top 1 nc_id,nc_kaoshiId,nc_qid,nc_daanid,bit_isRight,nvc_chengji,dt_shijian,nc_uid from kaoshi "); 212 | strSql.Append(" where nc_id=@nc_id "); 213 | SqlParameter[] parameters = { 214 | new SqlParameter("@nc_id", SqlDbType.NChar,20) }; 215 | parameters[0].Value = nc_id; 216 | 217 | kaoshiModel model = new kaoshiModel(); 218 | DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); 219 | if (ds.Tables[0].Rows.Count > 0) 220 | { 221 | return DataRowToModel(ds.Tables[0].Rows[0]); 222 | } 223 | else 224 | { 225 | return null; 226 | } 227 | } 228 | 229 | 230 | /// 231 | /// 得到一个对象实体 232 | /// 233 | public kaoshiModel DataRowToModel(DataRow row) 234 | { 235 | kaoshiModel model = new kaoshiModel(); 236 | if (row != null) 237 | { 238 | if (row["nc_id"] != null) 239 | { 240 | model.nc_id = row["nc_id"].ToString(); 241 | } 242 | if (row["nc_kaoshiId"] != null) 243 | { 244 | model.nc_kaoshiId = row["nc_kaoshiId"].ToString(); 245 | } 246 | if (row["nc_qid"] != null) 247 | { 248 | model.nc_qid = row["nc_qid"].ToString(); 249 | } 250 | if (row["nc_daanid"] != null) 251 | { 252 | model.nc_daanid = row["nc_daanid"].ToString(); 253 | } 254 | if (row["bit_isRight"] != null && row["bit_isRight"].ToString() != "") 255 | { 256 | if ((row["bit_isRight"].ToString() == "1") || (row["bit_isRight"].ToString().ToLower() == "true")) 257 | { 258 | model.bit_isRight = true; 259 | } 260 | else 261 | { 262 | model.bit_isRight = false; 263 | } 264 | } 265 | if (row["nvc_chengji"] != null) 266 | { 267 | model.nvc_chengji = row["nvc_chengji"].ToString(); 268 | } 269 | if (row["dt_shijian"] != null && row["dt_shijian"].ToString() != "") 270 | { 271 | model.dt_shijian = DateTime.Parse(row["dt_shijian"].ToString()); 272 | } 273 | if (row["nc_uid"] != null) 274 | { 275 | model.nc_uid = row["nc_uid"].ToString(); 276 | } 277 | } 278 | return model; 279 | } 280 | 281 | /// 282 | /// 获得数据列表 283 | /// 284 | public DataSet GetList(string strWhere) 285 | { 286 | StringBuilder strSql = new StringBuilder(); 287 | strSql.Append("select nc_id,nc_kaoshiId,nc_qid,nc_daanid,bit_isRight,nvc_chengji,dt_shijian,nc_uid "); 288 | strSql.Append(" FROM kaoshi "); 289 | if (strWhere.Trim() != "") 290 | { 291 | strSql.Append(" where " + strWhere); 292 | } 293 | return DbHelperSQL.Query(strSql.ToString()); 294 | } 295 | 296 | /// 297 | /// 获得前几行数据 298 | /// 299 | public DataSet GetList(int Top, string strWhere, string filedOrder) 300 | { 301 | StringBuilder strSql = new StringBuilder(); 302 | strSql.Append("select "); 303 | if (Top > 0) 304 | { 305 | strSql.Append(" top " + Top.ToString()); 306 | } 307 | strSql.Append(" nc_id,nc_kaoshiId,nc_qid,nc_daanid,bit_isRight,nvc_chengji,dt_shijian,nc_uid "); 308 | strSql.Append(" FROM kaoshi "); 309 | if (strWhere.Trim() != "") 310 | { 311 | strSql.Append(" where " + strWhere); 312 | } 313 | strSql.Append(" order by " + filedOrder); 314 | return DbHelperSQL.Query(strSql.ToString()); 315 | } 316 | 317 | /// 318 | /// 获取记录总数 319 | /// 320 | public int GetRecordCount(string strWhere) 321 | { 322 | StringBuilder strSql = new StringBuilder(); 323 | strSql.Append("select count(1) FROM kaoshi "); 324 | if (strWhere.Trim() != "") 325 | { 326 | strSql.Append(" where " + strWhere); 327 | } 328 | object obj = DbHelperSQL.GetSingle(strSql.ToString()); 329 | if (obj == null) 330 | { 331 | return 0; 332 | } 333 | else 334 | { 335 | return Convert.ToInt32(obj); 336 | } 337 | } 338 | /// 339 | /// 分页获取数据列表 340 | /// 341 | public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 342 | { 343 | StringBuilder strSql = new StringBuilder(); 344 | strSql.Append("SELECT * FROM ( "); 345 | strSql.Append(" SELECT ROW_NUMBER() OVER ("); 346 | if (!string.IsNullOrEmpty(orderby.Trim())) 347 | { 348 | strSql.Append("order by T." + orderby); 349 | } 350 | else 351 | { 352 | strSql.Append("order by T.nc_id desc"); 353 | } 354 | strSql.Append(")AS Row, T.* from kaoshi T "); 355 | if (!string.IsNullOrEmpty(strWhere.Trim())) 356 | { 357 | strSql.Append(" WHERE " + strWhere); 358 | } 359 | strSql.Append(" ) TT"); 360 | strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); 361 | return DbHelperSQL.Query(strSql.ToString()); 362 | } 363 | 364 | /* 365 | /// 366 | /// 分页获取数据列表 367 | /// 368 | public DataSet GetList(int PageSize,int PageIndex,string strWhere) 369 | { 370 | SqlParameter[] parameters = { 371 | new SqlParameter("@tblName", SqlDbType.VarChar, 255), 372 | new SqlParameter("@fldName", SqlDbType.VarChar, 255), 373 | new SqlParameter("@PageSize", SqlDbType.Int), 374 | new SqlParameter("@PageIndex", SqlDbType.Int), 375 | new SqlParameter("@IsReCount", SqlDbType.Bit), 376 | new SqlParameter("@OrderType", SqlDbType.Bit), 377 | new SqlParameter("@strWhere", SqlDbType.VarChar,1000), 378 | }; 379 | parameters[0].Value = "kaoshi"; 380 | parameters[1].Value = "nc_id"; 381 | parameters[2].Value = PageSize; 382 | parameters[3].Value = PageIndex; 383 | parameters[4].Value = 0; 384 | parameters[5].Value = 0; 385 | parameters[6].Value = strWhere; 386 | return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); 387 | }*/ 388 | 389 | #endregion BasicMethod 390 | #region ExtensionMethod 391 | 392 | #endregion ExtensionMethod 393 | } 394 | } 395 | 396 | -------------------------------------------------------------------------------- /Code/App_Code/DAL/optionsDAL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | using DBUtility; 6 | using Model;//Please add references 7 | namespace DAL 8 | { 9 | /// 10 | /// 数据访问类:options 11 | /// 12 | public partial class optionsDAL 13 | { 14 | public optionsDAL() 15 | {} 16 | #region BasicMethod 17 | 18 | /// 19 | /// 是否存在该记录 20 | /// 21 | public bool Exists(string nc_opid) 22 | { 23 | StringBuilder strSql=new StringBuilder(); 24 | strSql.Append("select count(1) from options"); 25 | strSql.Append(" where nc_opid=@nc_opid "); 26 | SqlParameter[] parameters = { 27 | new SqlParameter("@nc_opid", SqlDbType.NChar,12) }; 28 | parameters[0].Value = nc_opid; 29 | 30 | return DbHelperSQL.Exists(strSql.ToString(),parameters); 31 | } 32 | 33 | 34 | /// 35 | /// 增加一条数据 36 | /// 37 | public bool Add(optionsModel model) 38 | { 39 | StringBuilder strSql=new StringBuilder(); 40 | strSql.Append("insert into options("); 41 | strSql.Append("nc_opid,nc_qid,nvc_opcontent,bit_isright)"); 42 | strSql.Append(" values ("); 43 | strSql.Append("@nc_opid,@nc_qid,@nvc_opcontent,@bit_isright)"); 44 | SqlParameter[] parameters = { 45 | new SqlParameter("@nc_opid", SqlDbType.NChar,12), 46 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 47 | new SqlParameter("@nvc_opcontent", SqlDbType.NVarChar,2000), 48 | new SqlParameter("@bit_isright", SqlDbType.Bit,1)}; 49 | parameters[0].Value = model.nc_opid; 50 | parameters[1].Value = model.nc_qid; 51 | parameters[2].Value = model.nvc_opcontent; 52 | parameters[3].Value = model.bit_isright; 53 | 54 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 55 | if (rows > 0) 56 | { 57 | return true; 58 | } 59 | else 60 | { 61 | return false; 62 | } 63 | } 64 | /// 65 | /// 更新一条数据 66 | /// 67 | public bool Update(optionsModel model) 68 | { 69 | StringBuilder strSql=new StringBuilder(); 70 | strSql.Append("update options set "); 71 | strSql.Append("nc_qid=@nc_qid,"); 72 | strSql.Append("nvc_opcontent=@nvc_opcontent,"); 73 | strSql.Append("bit_isright=@bit_isright"); 74 | strSql.Append(" where nc_opid=@nc_opid "); 75 | SqlParameter[] parameters = { 76 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 77 | new SqlParameter("@nvc_opcontent", SqlDbType.NVarChar,2000), 78 | new SqlParameter("@bit_isright", SqlDbType.Bit,1), 79 | new SqlParameter("@nc_opid", SqlDbType.NChar,12)}; 80 | parameters[0].Value = model.nc_qid; 81 | parameters[1].Value = model.nvc_opcontent; 82 | parameters[2].Value = model.bit_isright; 83 | parameters[3].Value = model.nc_opid; 84 | 85 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 86 | if (rows > 0) 87 | { 88 | return true; 89 | } 90 | else 91 | { 92 | return false; 93 | } 94 | } 95 | 96 | /// 97 | /// 删除一条数据 98 | /// 99 | public bool Delete(string nc_opid) 100 | { 101 | 102 | StringBuilder strSql=new StringBuilder(); 103 | strSql.Append("delete from options "); 104 | strSql.Append(" where nc_opid=@nc_opid "); 105 | SqlParameter[] parameters = { 106 | new SqlParameter("@nc_opid", SqlDbType.NChar,12) }; 107 | parameters[0].Value = nc_opid; 108 | 109 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 110 | if (rows > 0) 111 | { 112 | return true; 113 | } 114 | else 115 | { 116 | return false; 117 | } 118 | } 119 | /// 120 | /// 批量删除数据 121 | /// 122 | public bool DeleteList(string nc_opidlist ) 123 | { 124 | StringBuilder strSql=new StringBuilder(); 125 | strSql.Append("delete from options "); 126 | strSql.Append(" where nc_opid in ("+nc_opidlist + ") "); 127 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 128 | if (rows > 0) 129 | { 130 | return true; 131 | } 132 | else 133 | { 134 | return false; 135 | } 136 | } 137 | 138 | 139 | /// 140 | /// 得到一个对象实体 141 | /// 142 | public optionsModel GetModel(string nc_opid) 143 | { 144 | 145 | StringBuilder strSql=new StringBuilder(); 146 | strSql.Append("select top 1 nc_opid,nc_qid,nvc_opcontent,bit_isright from options "); 147 | strSql.Append(" where nc_opid=@nc_opid "); 148 | SqlParameter[] parameters = { 149 | new SqlParameter("@nc_opid", SqlDbType.NChar,12) }; 150 | parameters[0].Value = nc_opid; 151 | 152 | optionsModel model=new optionsModel(); 153 | DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 154 | if(ds.Tables[0].Rows.Count>0) 155 | { 156 | return DataRowToModel(ds.Tables[0].Rows[0]); 157 | } 158 | else 159 | { 160 | return null; 161 | } 162 | } 163 | 164 | 165 | /// 166 | /// 得到一个对象实体 167 | /// 168 | public optionsModel DataRowToModel(DataRow row) 169 | { 170 | optionsModel model=new optionsModel(); 171 | if (row != null) 172 | { 173 | if(row["nc_opid"]!=null) 174 | { 175 | model.nc_opid=row["nc_opid"].ToString(); 176 | } 177 | if(row["nc_qid"]!=null) 178 | { 179 | model.nc_qid=row["nc_qid"].ToString(); 180 | } 181 | if(row["nvc_opcontent"]!=null) 182 | { 183 | model.nvc_opcontent=row["nvc_opcontent"].ToString(); 184 | } 185 | if(row["bit_isright"]!=null && row["bit_isright"].ToString()!="") 186 | { 187 | if((row["bit_isright"].ToString()=="1")||(row["bit_isright"].ToString().ToLower()=="true")) 188 | { 189 | model.bit_isright=true; 190 | } 191 | else 192 | { 193 | model.bit_isright=false; 194 | } 195 | } 196 | } 197 | return model; 198 | } 199 | 200 | /// 201 | /// 获得数据列表 202 | /// 203 | public DataSet GetList(string strWhere) 204 | { 205 | StringBuilder strSql=new StringBuilder(); 206 | strSql.Append("select nc_opid,nc_qid,nvc_opcontent,bit_isright "); 207 | strSql.Append(" FROM options "); 208 | if(strWhere.Trim()!="") 209 | { 210 | strSql.Append(" where "+strWhere); 211 | } 212 | return DbHelperSQL.Query(strSql.ToString()); 213 | } 214 | 215 | /// 216 | /// 获得前几行数据 217 | /// 218 | public DataSet GetList(int Top,string strWhere,string filedOrder) 219 | { 220 | StringBuilder strSql=new StringBuilder(); 221 | strSql.Append("select "); 222 | if(Top>0) 223 | { 224 | strSql.Append(" top "+Top.ToString()); 225 | } 226 | strSql.Append(" nc_opid,nc_qid,nvc_opcontent,bit_isright "); 227 | strSql.Append(" FROM options "); 228 | if(strWhere.Trim()!="") 229 | { 230 | strSql.Append(" where "+strWhere); 231 | } 232 | strSql.Append(" order by " + filedOrder); 233 | return DbHelperSQL.Query(strSql.ToString()); 234 | } 235 | 236 | /// 237 | /// 获取记录总数 238 | /// 239 | public int GetRecordCount(string strWhere) 240 | { 241 | StringBuilder strSql=new StringBuilder(); 242 | strSql.Append("select count(1) FROM options "); 243 | if(strWhere.Trim()!="") 244 | { 245 | strSql.Append(" where "+strWhere); 246 | } 247 | object obj = DbHelperSQL.GetSingle(strSql.ToString()); 248 | if (obj == null) 249 | { 250 | return 0; 251 | } 252 | else 253 | { 254 | return Convert.ToInt32(obj); 255 | } 256 | } 257 | /// 258 | /// 分页获取数据列表 259 | /// 260 | public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 261 | { 262 | StringBuilder strSql=new StringBuilder(); 263 | strSql.Append("SELECT * FROM ( "); 264 | strSql.Append(" SELECT ROW_NUMBER() OVER ("); 265 | if (!string.IsNullOrEmpty(orderby.Trim())) 266 | { 267 | strSql.Append("order by T." + orderby ); 268 | } 269 | else 270 | { 271 | strSql.Append("order by T.nc_opid desc"); 272 | } 273 | strSql.Append(")AS Row, T.* from options T "); 274 | if (!string.IsNullOrEmpty(strWhere.Trim())) 275 | { 276 | strSql.Append(" WHERE " + strWhere); 277 | } 278 | strSql.Append(" ) TT"); 279 | strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); 280 | return DbHelperSQL.Query(strSql.ToString()); 281 | } 282 | 283 | /* 284 | /// 285 | /// 分页获取数据列表 286 | /// 287 | public DataSet GetList(int PageSize,int PageIndex,string strWhere) 288 | { 289 | SqlParameter[] parameters = { 290 | new SqlParameter("@tblName", SqlDbType.VarChar, 255), 291 | new SqlParameter("@fldName", SqlDbType.VarChar, 255), 292 | new SqlParameter("@PageSize", SqlDbType.Int), 293 | new SqlParameter("@PageIndex", SqlDbType.Int), 294 | new SqlParameter("@IsReCount", SqlDbType.Bit), 295 | new SqlParameter("@OrderType", SqlDbType.Bit), 296 | new SqlParameter("@strWhere", SqlDbType.VarChar,1000), 297 | }; 298 | parameters[0].Value = "options"; 299 | parameters[1].Value = "nc_opid"; 300 | parameters[2].Value = PageSize; 301 | parameters[3].Value = PageIndex; 302 | parameters[4].Value = 0; 303 | parameters[5].Value = 0; 304 | parameters[6].Value = strWhere; 305 | return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); 306 | }*/ 307 | 308 | #endregion BasicMethod 309 | #region ExtensionMethod 310 | 311 | #endregion ExtensionMethod 312 | } 313 | } 314 | 315 | -------------------------------------------------------------------------------- /Code/App_Code/DAL/questionDAL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | using DBUtility; 6 | using Model;//Please add references 7 | namespace DAL 8 | { 9 | /// 10 | /// 数据访问类:question 11 | /// 12 | public partial class questionDAL 13 | { 14 | public questionDAL() 15 | {} 16 | #region BasicMethod 17 | 18 | /// 19 | /// 是否存在该记录 20 | /// 21 | public bool Exists(string nc_qid) 22 | { 23 | StringBuilder strSql=new StringBuilder(); 24 | strSql.Append("select count(1) from question"); 25 | strSql.Append(" where nc_qid=@nc_qid "); 26 | SqlParameter[] parameters = { 27 | new SqlParameter("@nc_qid", SqlDbType.NChar,10) }; 28 | parameters[0].Value = nc_qid; 29 | 30 | return DbHelperSQL.Exists(strSql.ToString(),parameters); 31 | } 32 | 33 | 34 | /// 35 | /// 增加一条数据 36 | /// 37 | public bool Add(questionModel model) 38 | { 39 | StringBuilder strSql=new StringBuilder(); 40 | strSql.Append("insert into question("); 41 | strSql.Append("nc_qid,nvc_qcontent,int_qtype,nvc_source)"); 42 | strSql.Append(" values ("); 43 | strSql.Append("@nc_qid,@nvc_qcontent,@int_qtype,@nvc_source)"); 44 | SqlParameter[] parameters = { 45 | new SqlParameter("@nc_qid", SqlDbType.NChar,10), 46 | new SqlParameter("@nvc_qcontent", SqlDbType.NVarChar,2000), 47 | new SqlParameter("@int_qtype", SqlDbType.Int,4), 48 | new SqlParameter("@nvc_source", SqlDbType.NVarChar,500)}; 49 | parameters[0].Value = model.nc_qid; 50 | parameters[1].Value = model.nvc_qcontent; 51 | parameters[2].Value = model.int_qtype; 52 | parameters[3].Value = model.nvc_source; 53 | 54 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 55 | if (rows > 0) 56 | { 57 | return true; 58 | } 59 | else 60 | { 61 | return false; 62 | } 63 | } 64 | /// 65 | /// 更新一条数据 66 | /// 67 | public bool Update(questionModel model) 68 | { 69 | StringBuilder strSql=new StringBuilder(); 70 | strSql.Append("update question set "); 71 | strSql.Append("nvc_qcontent=@nvc_qcontent,"); 72 | strSql.Append("int_qtype=@int_qtype,"); 73 | strSql.Append("nvc_source=@nvc_source"); 74 | strSql.Append(" where nc_qid=@nc_qid "); 75 | SqlParameter[] parameters = { 76 | new SqlParameter("@nvc_qcontent", SqlDbType.NVarChar,2000), 77 | new SqlParameter("@int_qtype", SqlDbType.Int,4), 78 | new SqlParameter("@nvc_source", SqlDbType.NVarChar,500), 79 | new SqlParameter("@nc_qid", SqlDbType.NChar,10)}; 80 | parameters[0].Value = model.nvc_qcontent; 81 | parameters[1].Value = model.int_qtype; 82 | parameters[2].Value = model.nvc_source; 83 | parameters[3].Value = model.nc_qid; 84 | 85 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 86 | if (rows > 0) 87 | { 88 | return true; 89 | } 90 | else 91 | { 92 | return false; 93 | } 94 | } 95 | 96 | /// 97 | /// 删除一条数据 98 | /// 99 | public bool Delete(string nc_qid) 100 | { 101 | 102 | StringBuilder strSql=new StringBuilder(); 103 | strSql.Append("delete from question "); 104 | strSql.Append(" where nc_qid=@nc_qid "); 105 | SqlParameter[] parameters = { 106 | new SqlParameter("@nc_qid", SqlDbType.NChar,10) }; 107 | parameters[0].Value = nc_qid; 108 | 109 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 110 | if (rows > 0) 111 | { 112 | return true; 113 | } 114 | else 115 | { 116 | return false; 117 | } 118 | } 119 | /// 120 | /// 批量删除数据 121 | /// 122 | public bool DeleteList(string nc_qidlist ) 123 | { 124 | StringBuilder strSql=new StringBuilder(); 125 | strSql.Append("delete from question "); 126 | strSql.Append(" where nc_qid in ("+nc_qidlist + ") "); 127 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 128 | if (rows > 0) 129 | { 130 | return true; 131 | } 132 | else 133 | { 134 | return false; 135 | } 136 | } 137 | 138 | 139 | /// 140 | /// 得到一个对象实体 141 | /// 142 | public questionModel GetModel(string nc_qid) 143 | { 144 | 145 | StringBuilder strSql=new StringBuilder(); 146 | strSql.Append("select top 1 nc_qid,nvc_qcontent,int_qtype,nvc_source from question "); 147 | strSql.Append(" where nc_qid=@nc_qid "); 148 | SqlParameter[] parameters = { 149 | new SqlParameter("@nc_qid", SqlDbType.NChar,10) }; 150 | parameters[0].Value = nc_qid; 151 | 152 | questionModel model=new questionModel(); 153 | DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 154 | if(ds.Tables[0].Rows.Count>0) 155 | { 156 | return DataRowToModel(ds.Tables[0].Rows[0]); 157 | } 158 | else 159 | { 160 | return null; 161 | } 162 | } 163 | 164 | 165 | /// 166 | /// 得到一个对象实体 167 | /// 168 | public questionModel DataRowToModel(DataRow row) 169 | { 170 | questionModel model=new questionModel(); 171 | if (row != null) 172 | { 173 | if(row["nc_qid"]!=null) 174 | { 175 | model.nc_qid=row["nc_qid"].ToString(); 176 | } 177 | if(row["nvc_qcontent"]!=null) 178 | { 179 | model.nvc_qcontent=row["nvc_qcontent"].ToString(); 180 | } 181 | if(row["int_qtype"]!=null && row["int_qtype"].ToString()!="") 182 | { 183 | model.int_qtype=int.Parse(row["int_qtype"].ToString()); 184 | } 185 | if(row["nvc_source"]!=null) 186 | { 187 | model.nvc_source=row["nvc_source"].ToString(); 188 | } 189 | } 190 | return model; 191 | } 192 | 193 | /// 194 | /// 获得数据列表 195 | /// 196 | public DataSet GetList(string strWhere) 197 | { 198 | StringBuilder strSql=new StringBuilder(); 199 | strSql.Append("select nc_qid,nvc_qcontent,int_qtype,nvc_source "); 200 | strSql.Append(" FROM question "); 201 | if(strWhere.Trim()!="") 202 | { 203 | strSql.Append(strWhere); 204 | } 205 | return DbHelperSQL.Query(strSql.ToString()); 206 | } 207 | 208 | /// 209 | /// 获得前几行数据 210 | /// 211 | public DataSet GetList(int Top,string strWhere,string filedOrder) 212 | { 213 | StringBuilder strSql=new StringBuilder(); 214 | strSql.Append("select "); 215 | if(Top>0) 216 | { 217 | strSql.Append(" top "+Top.ToString()); 218 | } 219 | strSql.Append(" nc_qid,nvc_qcontent,int_qtype,nvc_source "); 220 | strSql.Append(" FROM question "); 221 | if(strWhere.Trim()!="") 222 | { 223 | strSql.Append(" where "+strWhere); 224 | } 225 | strSql.Append(" order by " + filedOrder); 226 | return DbHelperSQL.Query(strSql.ToString()); 227 | } 228 | 229 | /// 230 | /// 获取记录总数 231 | /// 232 | public int GetRecordCount(string strWhere) 233 | { 234 | StringBuilder strSql=new StringBuilder(); 235 | strSql.Append("select count(1) FROM question "); 236 | if(strWhere.Trim()!="") 237 | { 238 | strSql.Append(" where "+strWhere); 239 | } 240 | object obj = DbHelperSQL.GetSingle(strSql.ToString()); 241 | if (obj == null) 242 | { 243 | return 0; 244 | } 245 | else 246 | { 247 | return Convert.ToInt32(obj); 248 | } 249 | } 250 | /// 251 | /// 分页获取数据列表 252 | /// 253 | public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 254 | { 255 | StringBuilder strSql=new StringBuilder(); 256 | strSql.Append("SELECT * FROM ( "); 257 | strSql.Append(" SELECT ROW_NUMBER() OVER ("); 258 | if (!string.IsNullOrEmpty(orderby.Trim())) 259 | { 260 | strSql.Append("order by T." + orderby ); 261 | } 262 | else 263 | { 264 | strSql.Append("order by T.nc_qid desc"); 265 | } 266 | strSql.Append(")AS Row, T.* from question T "); 267 | if (!string.IsNullOrEmpty(strWhere.Trim())) 268 | { 269 | strSql.Append(" WHERE " + strWhere); 270 | } 271 | strSql.Append(" ) TT"); 272 | strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); 273 | return DbHelperSQL.Query(strSql.ToString()); 274 | } 275 | 276 | /* 277 | /// 278 | /// 分页获取数据列表 279 | /// 280 | public DataSet GetList(int PageSize,int PageIndex,string strWhere) 281 | { 282 | SqlParameter[] parameters = { 283 | new SqlParameter("@tblName", SqlDbType.VarChar, 255), 284 | new SqlParameter("@fldName", SqlDbType.VarChar, 255), 285 | new SqlParameter("@PageSize", SqlDbType.Int), 286 | new SqlParameter("@PageIndex", SqlDbType.Int), 287 | new SqlParameter("@IsReCount", SqlDbType.Bit), 288 | new SqlParameter("@OrderType", SqlDbType.Bit), 289 | new SqlParameter("@strWhere", SqlDbType.VarChar,1000), 290 | }; 291 | parameters[0].Value = "question"; 292 | parameters[1].Value = "nc_qid"; 293 | parameters[2].Value = PageSize; 294 | parameters[3].Value = PageIndex; 295 | parameters[4].Value = 0; 296 | parameters[5].Value = 0; 297 | parameters[6].Value = strWhere; 298 | return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); 299 | }*/ 300 | 301 | #endregion BasicMethod 302 | #region ExtensionMethod 303 | 304 | #endregion ExtensionMethod 305 | } 306 | } 307 | 308 | -------------------------------------------------------------------------------- /Code/App_Code/DAL/yonghuDAL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | using DBUtility; 6 | using Model;//Please add references 7 | namespace DAL 8 | { 9 | /// 10 | /// 数据访问类:yonghu 11 | /// 12 | public partial class yonghuDAL 13 | { 14 | public yonghuDAL() 15 | {} 16 | #region BasicMethod 17 | 18 | /// 19 | /// 是否存在该记录 20 | /// 21 | public bool ExistsUserName(string nvc_username) 22 | { 23 | StringBuilder strSql=new StringBuilder(); 24 | strSql.Append("select count(1) from yonghu"); 25 | strSql.Append(" where nvc_username=@nvc_username "); 26 | SqlParameter[] parameters = { 27 | new SqlParameter("@nvc_username", SqlDbType.NVarChar,50) }; 28 | parameters[0].Value = nvc_username; 29 | 30 | return DbHelperSQL.Exists(strSql.ToString(),parameters); 31 | } 32 | 33 | 34 | /// 35 | /// 增加一条数据 36 | /// 37 | public bool Add(yonghuModel model) 38 | { 39 | StringBuilder strSql=new StringBuilder(); 40 | strSql.Append("insert into yonghu("); 41 | strSql.Append("nvc_username,nvc_pwd,int_right)"); 42 | strSql.Append(" values ("); 43 | strSql.Append("@nvc_username,@nvc_pwd,@int_right)"); 44 | SqlParameter[] parameters = { 45 | new SqlParameter("@nvc_username", SqlDbType.NVarChar,50), 46 | new SqlParameter("@nvc_pwd", SqlDbType.NVarChar,50), 47 | new SqlParameter("@int_right", SqlDbType.Int,4)}; 48 | parameters[0].Value = model.nvc_username; 49 | parameters[1].Value = model.nvc_pwd; 50 | parameters[2].Value = model.int_right; 51 | 52 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 53 | if (rows > 0) 54 | { 55 | return true; 56 | } 57 | else 58 | { 59 | return false; 60 | } 61 | } 62 | /// 63 | /// 更新一条数据 64 | /// 65 | public bool Update(yonghuModel model) 66 | { 67 | StringBuilder strSql=new StringBuilder(); 68 | strSql.Append("update yonghu set "); 69 | strSql.Append("nvc_username=@nvc_username,"); 70 | strSql.Append("nvc_pwd=@nvc_pwd,"); 71 | strSql.Append("int_right=@int_right,"); 72 | strSql.Append("dt_register=@dt_register"); 73 | strSql.Append(" where nc_uid=@nc_uid "); 74 | SqlParameter[] parameters = { 75 | new SqlParameter("@nvc_username", SqlDbType.NVarChar,50), 76 | new SqlParameter("@nvc_pwd", SqlDbType.NVarChar,50), 77 | new SqlParameter("@int_right", SqlDbType.Int,4), 78 | new SqlParameter("@dt_register", SqlDbType.DateTime), 79 | new SqlParameter("@nc_uid", SqlDbType.NChar,20)}; 80 | parameters[0].Value = model.nvc_username; 81 | parameters[1].Value = model.nvc_pwd; 82 | parameters[2].Value = model.int_right; 83 | parameters[3].Value = model.dt_register; 84 | parameters[4].Value = model.nc_uid; 85 | 86 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 87 | if (rows > 0) 88 | { 89 | return true; 90 | } 91 | else 92 | { 93 | return false; 94 | } 95 | } 96 | 97 | /// 98 | /// 删除一条数据 99 | /// 100 | public bool Delete(string nc_uid) 101 | { 102 | 103 | StringBuilder strSql=new StringBuilder(); 104 | strSql.Append("delete from yonghu "); 105 | strSql.Append(" where nc_uid=@nc_uid "); 106 | SqlParameter[] parameters = { 107 | new SqlParameter("@nc_uid", SqlDbType.NChar,20) }; 108 | parameters[0].Value = nc_uid; 109 | 110 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 111 | if (rows > 0) 112 | { 113 | return true; 114 | } 115 | else 116 | { 117 | return false; 118 | } 119 | } 120 | /// 121 | /// 批量删除数据 122 | /// 123 | public bool DeleteList(string nc_uidlist ) 124 | { 125 | StringBuilder strSql=new StringBuilder(); 126 | strSql.Append("delete from yonghu "); 127 | strSql.Append(" where nc_uid in ("+nc_uidlist + ") "); 128 | int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 129 | if (rows > 0) 130 | { 131 | return true; 132 | } 133 | else 134 | { 135 | return false; 136 | } 137 | } 138 | 139 | 140 | /// 141 | /// 得到一个对象实体 142 | /// 143 | public yonghuModel GetModelById(string nc_uid) 144 | { 145 | 146 | StringBuilder strSql=new StringBuilder(); 147 | strSql.Append("select top 1 nc_uid,nvc_username,nvc_pwd,int_right,dt_register from yonghu "); 148 | strSql.Append(" where nc_uid=@nc_uid "); 149 | SqlParameter[] parameters = { 150 | new SqlParameter("@nc_uid", SqlDbType.NChar,20) }; 151 | parameters[0].Value = nc_uid; 152 | 153 | yonghuModel model=new yonghuModel(); 154 | DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 155 | if(ds.Tables[0].Rows.Count>0) 156 | { 157 | return DataRowToModel(ds.Tables[0].Rows[0]); 158 | } 159 | else 160 | { 161 | return null; 162 | } 163 | } 164 | 165 | 166 | /// 167 | /// 得到一个对象实体 168 | /// 169 | public yonghuModel GetModelByUsername(string username) 170 | { 171 | 172 | StringBuilder strSql = new StringBuilder(); 173 | strSql.Append("select top 1 nc_uid,nvc_username,nvc_pwd,int_right,dt_register from yonghu "); 174 | strSql.Append(" where nvc_username=@nvc_username "); 175 | SqlParameter[] parameters = { 176 | new SqlParameter("@nvc_username", SqlDbType.NVarChar,50) }; 177 | parameters[0].Value = username; 178 | 179 | yonghuModel model = new yonghuModel(); 180 | DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); 181 | if (ds.Tables[0].Rows.Count > 0) 182 | { 183 | return DataRowToModel(ds.Tables[0].Rows[0]); 184 | } 185 | else 186 | { 187 | return null; 188 | } 189 | } 190 | 191 | /// 192 | /// 得到一个对象实体 193 | /// 194 | public yonghuModel DataRowToModel(DataRow row) 195 | { 196 | yonghuModel model=new yonghuModel(); 197 | if (row != null) 198 | { 199 | if(row["nc_uid"]!=null) 200 | { 201 | model.nc_uid=row["nc_uid"].ToString(); 202 | } 203 | if(row["nvc_username"]!=null) 204 | { 205 | model.nvc_username=row["nvc_username"].ToString(); 206 | } 207 | if(row["nvc_pwd"]!=null) 208 | { 209 | model.nvc_pwd=row["nvc_pwd"].ToString(); 210 | } 211 | if(row["int_right"]!=null && row["int_right"].ToString()!="") 212 | { 213 | model.int_right=int.Parse(row["int_right"].ToString()); 214 | } 215 | if(row["dt_register"]!=null && row["dt_register"].ToString()!="") 216 | { 217 | model.dt_register=DateTime.Parse(row["dt_register"].ToString()); 218 | } 219 | } 220 | return model; 221 | } 222 | 223 | /// 224 | /// 获得数据列表 225 | /// 226 | public DataSet GetList(string strWhere) 227 | { 228 | StringBuilder strSql=new StringBuilder(); 229 | strSql.Append("select nc_uid,nvc_username,nvc_pwd,int_right,dt_register "); 230 | strSql.Append(" FROM yonghu "); 231 | if(strWhere.Trim()!="") 232 | { 233 | strSql.Append(" where "+strWhere); 234 | } 235 | return DbHelperSQL.Query(strSql.ToString()); 236 | } 237 | 238 | /// 239 | /// 获得前几行数据 240 | /// 241 | public DataSet GetList(int Top,string strWhere,string filedOrder) 242 | { 243 | StringBuilder strSql=new StringBuilder(); 244 | strSql.Append("select "); 245 | if(Top>0) 246 | { 247 | strSql.Append(" top "+Top.ToString()); 248 | } 249 | strSql.Append(" nc_uid,nvc_username,nvc_pwd,int_right,dt_register "); 250 | strSql.Append(" FROM yonghu "); 251 | if(strWhere.Trim()!="") 252 | { 253 | strSql.Append(" where "+strWhere); 254 | } 255 | strSql.Append(" order by " + filedOrder); 256 | return DbHelperSQL.Query(strSql.ToString()); 257 | } 258 | 259 | /// 260 | /// 获取记录总数 261 | /// 262 | public int GetRecordCount(string strWhere) 263 | { 264 | StringBuilder strSql=new StringBuilder(); 265 | strSql.Append("select count(1) FROM yonghu "); 266 | if(strWhere.Trim()!="") 267 | { 268 | strSql.Append(" where "+strWhere); 269 | } 270 | object obj = DbHelperSQL.GetSingle(strSql.ToString()); 271 | if (obj == null) 272 | { 273 | return 0; 274 | } 275 | else 276 | { 277 | return Convert.ToInt32(obj); 278 | } 279 | } 280 | /// 281 | /// 分页获取数据列表 282 | /// 283 | public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 284 | { 285 | StringBuilder strSql=new StringBuilder(); 286 | strSql.Append("SELECT * FROM ( "); 287 | strSql.Append(" SELECT ROW_NUMBER() OVER ("); 288 | if (!string.IsNullOrEmpty(orderby.Trim())) 289 | { 290 | strSql.Append("order by T." + orderby ); 291 | } 292 | else 293 | { 294 | strSql.Append("order by T.nc_uid desc"); 295 | } 296 | strSql.Append(")AS Row, T.* from yonghu T "); 297 | if (!string.IsNullOrEmpty(strWhere.Trim())) 298 | { 299 | strSql.Append(" WHERE " + strWhere); 300 | } 301 | strSql.Append(" ) TT"); 302 | strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); 303 | return DbHelperSQL.Query(strSql.ToString()); 304 | } 305 | 306 | /* 307 | /// 308 | /// 分页获取数据列表 309 | /// 310 | public DataSet GetList(int PageSize,int PageIndex,string strWhere) 311 | { 312 | SqlParameter[] parameters = { 313 | new SqlParameter("@tblName", SqlDbType.VarChar, 255), 314 | new SqlParameter("@fldName", SqlDbType.VarChar, 255), 315 | new SqlParameter("@PageSize", SqlDbType.Int), 316 | new SqlParameter("@PageIndex", SqlDbType.Int), 317 | new SqlParameter("@IsReCount", SqlDbType.Bit), 318 | new SqlParameter("@OrderType", SqlDbType.Bit), 319 | new SqlParameter("@strWhere", SqlDbType.VarChar,1000), 320 | }; 321 | parameters[0].Value = "yonghu"; 322 | parameters[1].Value = "nc_uid"; 323 | parameters[2].Value = PageSize; 324 | parameters[3].Value = PageIndex; 325 | parameters[4].Value = 0; 326 | parameters[5].Value = 0; 327 | parameters[6].Value = strWhere; 328 | return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); 329 | }*/ 330 | 331 | #endregion BasicMethod 332 | #region ExtensionMethod 333 | 334 | #endregion ExtensionMethod 335 | } 336 | } 337 | 338 | -------------------------------------------------------------------------------- /Code/App_Code/DBUtility/CommandInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Data.SqlClient; 5 | 6 | namespace DBUtility 7 | { 8 | public enum EffentNextType 9 | { 10 | /// 11 | /// 对其他语句无任何影响 12 | /// 13 | None, 14 | /// 15 | /// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务 16 | /// 17 | WhenHaveContine, 18 | /// 19 | /// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务 20 | /// 21 | WhenNoHaveContine, 22 | /// 23 | /// 当前语句影响到的行数必须大于0,否则回滚事务 24 | /// 25 | ExcuteEffectRows, 26 | /// 27 | /// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务 28 | /// 29 | SolicitationEvent 30 | } 31 | public class CommandInfo 32 | { 33 | public object ShareObject = null; 34 | public object OriginalData = null; 35 | event EventHandler _solicitationEvent; 36 | public event EventHandler SolicitationEvent 37 | { 38 | add 39 | { 40 | _solicitationEvent += value; 41 | } 42 | remove 43 | { 44 | _solicitationEvent -= value; 45 | } 46 | } 47 | public void OnSolicitationEvent() 48 | { 49 | if (_solicitationEvent != null) 50 | { 51 | _solicitationEvent(this,new EventArgs()); 52 | } 53 | } 54 | public string CommandText; 55 | public System.Data.Common.DbParameter[] Parameters; 56 | public EffentNextType EffentNextType = EffentNextType.None; 57 | public CommandInfo() 58 | { 59 | 60 | } 61 | public CommandInfo(string sqlText, SqlParameter[] para) 62 | { 63 | this.CommandText = sqlText; 64 | this.Parameters = para; 65 | } 66 | public CommandInfo(string sqlText, SqlParameter[] para, EffentNextType type) 67 | { 68 | this.CommandText = sqlText; 69 | this.Parameters = para; 70 | this.EffentNextType = type; 71 | } 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /Code/App_Code/DBUtility/DESEncrypt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace DBUtility 6 | { 7 | /// 8 | /// DES加密/解密类。 9 | /// 10 | public class DESEncrypt 11 | { 12 | public DESEncrypt() 13 | { 14 | } 15 | 16 | #region ========加密======== 17 | 18 | /// 19 | /// 加密 20 | /// 21 | /// 22 | /// 23 | public static string Encrypt(string Text) 24 | { 25 | return Encrypt(Text, "fdy2014"); 26 | } 27 | /// 28 | /// 加密数据 29 | /// 30 | /// 31 | /// 32 | /// 33 | public static string Encrypt(string Text, string sKey) 34 | { 35 | DESCryptoServiceProvider des = new DESCryptoServiceProvider(); 36 | byte[] inputByteArray; 37 | inputByteArray = Encoding.Default.GetBytes(Text); 38 | des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); 39 | des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); 40 | System.IO.MemoryStream ms = new System.IO.MemoryStream(); 41 | CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write); 42 | cs.Write(inputByteArray, 0, inputByteArray.Length); 43 | cs.FlushFinalBlock(); 44 | StringBuilder ret = new StringBuilder(); 45 | foreach (byte b in ms.ToArray()) 46 | { 47 | ret.AppendFormat("{0:X2}", b); 48 | } 49 | return ret.ToString(); 50 | } 51 | 52 | #endregion 53 | 54 | #region ========解密======== 55 | 56 | 57 | /// 58 | /// 解密 59 | /// 60 | /// 61 | /// 62 | public static string Decrypt(string Text) 63 | { 64 | return Decrypt(Text, "fdy2014"); 65 | } 66 | /// 67 | /// 解密数据 68 | /// 69 | /// 70 | /// 71 | /// 72 | public static string Decrypt(string Text, string sKey) 73 | { 74 | DESCryptoServiceProvider des = new DESCryptoServiceProvider(); 75 | int len; 76 | len = Text.Length / 2; 77 | byte[] inputByteArray = new byte[len]; 78 | int x, i; 79 | for (x = 0; x < len; x++) 80 | { 81 | i = Convert.ToInt32(Text.Substring(x * 2, 2), 16); 82 | inputByteArray[x] = (byte)i; 83 | } 84 | des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); 85 | des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); 86 | System.IO.MemoryStream ms = new System.IO.MemoryStream(); 87 | CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write); 88 | cs.Write(inputByteArray, 0, inputByteArray.Length); 89 | cs.FlushFinalBlock(); 90 | return Encoding.Default.GetString(ms.ToArray()); 91 | } 92 | 93 | #endregion 94 | 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Code/App_Code/DBUtility/PubConstant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Configuration; 6 | 7 | namespace DBUtility 8 | { 9 | public class PubConstant 10 | { 11 | /// 12 | /// 获取连接字符串 13 | /// 14 | public static string ConnectionString 15 | { 16 | get 17 | { 18 | string _connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; 19 | //string _connectionString = ConfigurationManager.AppSettings["ConnectionString"].ToString(); 20 | //string ConStringEncrypt = ConfigurationManager.AppSettings["ConStringEncrypt"].ToString(); 21 | //if (ConStringEncrypt == "true") 22 | //{ 23 | // _connectionString = DESEncrypt.Decrypt(_connectionString); 24 | //} 25 | return _connectionString; 26 | } 27 | } 28 | 29 | /// 30 | /// 得到web.config里配置项的数据库连接字符串。 31 | /// 32 | /// 33 | /// 34 | public static string GetConnectionString(string configName) 35 | { 36 | string connectionString = ConfigurationManager.AppSettings[configName]; 37 | string ConStringEncrypt = ConfigurationManager.AppSettings["ConStringEncrypt"].ToString(); 38 | if (ConStringEncrypt == "true") 39 | { 40 | connectionString = DESEncrypt.Decrypt(connectionString); 41 | } 42 | return connectionString; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Code/App_Code/Model/cuotiModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Model 3 | { 4 | /// 5 | /// cuoti:实体类(属性说明自动提取数据库字段的描述信息) 6 | /// 7 | [Serializable] 8 | public partial class cuotiModel 9 | { 10 | public cuotiModel() 11 | {} 12 | #region Model 13 | private string _nc_ctid; 14 | private string _nc_qid; 15 | private string _nc_uid; 16 | /// 17 | /// 18 | /// 19 | public string nc_ctid 20 | { 21 | set{ _nc_ctid=value;} 22 | get{return _nc_ctid;} 23 | } 24 | /// 25 | /// 26 | /// 27 | public string nc_qid 28 | { 29 | set{ _nc_qid=value;} 30 | get{return _nc_qid;} 31 | } 32 | /// 33 | /// 34 | /// 35 | public string nc_uid 36 | { 37 | set{ _nc_uid=value;} 38 | get{return _nc_uid;} 39 | } 40 | #endregion Model 41 | 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Code/App_Code/Model/kaoshiModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Model 3 | { 4 | /// 5 | /// kaoshi:实体类(属性说明自动提取数据库字段的描述信息) 6 | /// 7 | [Serializable] 8 | public partial class kaoshiModel 9 | { 10 | public kaoshiModel() 11 | { } 12 | #region Model 13 | private string _nc_id; 14 | private string _nc_kaoshiid; 15 | private string _nc_qid; 16 | private string _nc_daanid; 17 | private bool _bit_isright; 18 | private string _nvc_chengji; 19 | private DateTime _dt_shijian; 20 | private string _nc_uid; 21 | /// 22 | /// 23 | /// 24 | public string nc_id 25 | { 26 | set { _nc_id = value; } 27 | get { return _nc_id; } 28 | } 29 | /// 30 | /// 31 | /// 32 | public string nc_kaoshiId 33 | { 34 | set { _nc_kaoshiid = value; } 35 | get { return _nc_kaoshiid; } 36 | } 37 | /// 38 | /// 39 | /// 40 | public string nc_qid 41 | { 42 | set { _nc_qid = value; } 43 | get { return _nc_qid; } 44 | } 45 | /// 46 | /// 47 | /// 48 | public string nc_daanid 49 | { 50 | set { _nc_daanid = value; } 51 | get { return _nc_daanid; } 52 | } 53 | /// 54 | /// 55 | /// 56 | public bool bit_isRight 57 | { 58 | set { _bit_isright = value; } 59 | get { return _bit_isright; } 60 | } 61 | /// 62 | /// 63 | /// 64 | public string nvc_chengji 65 | { 66 | set { _nvc_chengji = value; } 67 | get { return _nvc_chengji; } 68 | } 69 | /// 70 | /// 71 | /// 72 | public DateTime dt_shijian 73 | { 74 | set { _dt_shijian = value; } 75 | get { return _dt_shijian; } 76 | } 77 | /// 78 | /// 79 | /// 80 | public string nc_uid 81 | { 82 | set { _nc_uid = value; } 83 | get { return _nc_uid; } 84 | } 85 | #endregion Model 86 | 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /Code/App_Code/Model/optionsModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Model 3 | { 4 | /// 5 | /// options:实体类(属性说明自动提取数据库字段的描述信息) 6 | /// 7 | [Serializable] 8 | public partial class optionsModel 9 | { 10 | public optionsModel() 11 | {} 12 | #region Model 13 | private string _nc_opid; 14 | private string _nc_qid; 15 | private string _nvc_opcontent; 16 | private bool _bit_isright; 17 | /// 18 | /// 19 | /// 20 | public string nc_opid 21 | { 22 | set{ _nc_opid=value;} 23 | get{return _nc_opid;} 24 | } 25 | /// 26 | /// 27 | /// 28 | public string nc_qid 29 | { 30 | set{ _nc_qid=value;} 31 | get{return _nc_qid;} 32 | } 33 | /// 34 | /// 35 | /// 36 | public string nvc_opcontent 37 | { 38 | set{ _nvc_opcontent=value;} 39 | get{return _nvc_opcontent;} 40 | } 41 | /// 42 | /// 43 | /// 44 | public bool bit_isright 45 | { 46 | set{ _bit_isright=value;} 47 | get{return _bit_isright;} 48 | } 49 | #endregion Model 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Code/App_Code/Model/questionModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Model 3 | { 4 | /// 5 | /// question:实体类(属性说明自动提取数据库字段的描述信息) 6 | /// 7 | [Serializable] 8 | public partial class questionModel 9 | { 10 | public questionModel() 11 | {} 12 | #region Model 13 | private string _nc_qid; 14 | private string _nvc_qcontent; 15 | private int _int_qtype; 16 | private string _nvc_source; 17 | /// 18 | /// 19 | /// 20 | public string nc_qid 21 | { 22 | set{ _nc_qid=value;} 23 | get{return _nc_qid;} 24 | } 25 | /// 26 | /// 27 | /// 28 | public string nvc_qcontent 29 | { 30 | set{ _nvc_qcontent=value;} 31 | get{return _nvc_qcontent;} 32 | } 33 | /// 34 | /// 35 | /// 36 | public int int_qtype 37 | { 38 | set{ _int_qtype=value;} 39 | get{return _int_qtype;} 40 | } 41 | /// 42 | /// 43 | /// 44 | public string nvc_source 45 | { 46 | set{ _nvc_source=value;} 47 | get{return _nvc_source;} 48 | } 49 | #endregion Model 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Code/App_Code/Model/yonghuModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Model 3 | { 4 | /// 5 | /// 1 6 | /// 7 | [Serializable] 8 | public partial class yonghuModel 9 | { 10 | public yonghuModel() 11 | {} 12 | #region Model 13 | private string _nc_uid; 14 | private string _nvc_username; 15 | private string _nvc_pwd; 16 | private int _int_right; 17 | private DateTime _dt_register; 18 | /// 19 | /// 20 | /// 21 | public string nc_uid 22 | { 23 | set{ _nc_uid=value;} 24 | get{return _nc_uid;} 25 | } 26 | /// 27 | /// 28 | /// 29 | public string nvc_username 30 | { 31 | set{ _nvc_username=value;} 32 | get{return _nvc_username;} 33 | } 34 | /// 35 | /// 36 | /// 37 | public string nvc_pwd 38 | { 39 | set{ _nvc_pwd=value;} 40 | get{return _nvc_pwd;} 41 | } 42 | /// 43 | /// 44 | /// 45 | public int int_right 46 | { 47 | set{ _int_right=value;} 48 | get{return _int_right;} 49 | } 50 | /// 51 | /// 52 | /// 53 | public DateTime dt_register 54 | { 55 | set{ _dt_register=value;} 56 | get{return _dt_register;} 57 | } 58 | #endregion Model 59 | 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Code/App_Data/InformationSecurity.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/App_Data/InformationSecurity.mdf -------------------------------------------------------------------------------- /Code/App_Data/InformationSecurity_log.ldf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/App_Data/InformationSecurity_log.ldf -------------------------------------------------------------------------------- /Code/App_Data/sql.sql: -------------------------------------------------------------------------------- 1 | 2 | insert into [InformationSecurity].[dbo].[options] 3 | select * from Sheet1$ 4 | 5 | 6 | 7 | update Sheet1$ set bit_isright='false' where bit_isright='0' 8 | 9 | 10 | select * from Sheet1$ where nvc_opcontent=NULL -------------------------------------------------------------------------------- /Code/App_Data/题库.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/App_Data/题库.xls -------------------------------------------------------------------------------- /Code/Bin/NVelocity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/Bin/NVelocity.dll -------------------------------------------------------------------------------- /Code/Bin/NVelocity.dll.refresh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/Bin/NVelocity.dll.refresh -------------------------------------------------------------------------------- /Code/account/VerifyCode.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="VerifyCode" %> 2 | 3 | 4 | using System; 5 | using System.Collections; 6 | using System.Data; 7 | using System.Linq; 8 | using System.Web; 9 | using System.Web.Services; 10 | using System.Web.Services.Protocols; 11 | using System.Xml.Linq; 12 | using System.Drawing; 13 | using System.Web.SessionState; 14 | 15 | public class VerifyCode : IHttpHandler, IRequiresSessionState 16 | { 17 | private string CreateCheckCodeString() 18 | { //定义用于验证码的字符数组 19 | char[] AllCheckCodeArray ={'2','3','4','5','6','7','8', 20 | 'A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W', 21 | 'X','Y','a','b','c','d','e','f','g','h','i','j','k','m','n','p','q', 22 | 'r','s','t','u','v','w','x','y'}; 23 | //定义验证码字符串 24 | string randomcode = ""; 25 | Random rd = new Random(); 26 | //生成5位验证码字符串 27 | for (int i = 0; i < 5; i++) 28 | randomcode += AllCheckCodeArray[rd.Next(AllCheckCodeArray.Length)]; 29 | return randomcode; 30 | } 31 | public Color getColor() 32 | { 33 | // 自定义随机颜色数组 34 | Color[] colors = { Color.Red,Color.LightSalmon, Color.LightSeaGreen, Color.Magenta, 35 | Color.MediumSeaGreen, Color.SeaGreen, Color.Teal, Color.Tomato, Color.Coral, 36 | Color.CornflowerBlue, Color.DarkGreen, Color.DarkSalmon, Color.ForestGreen, 37 | Color.Goldenrod, Color.Gray, Color.Green,Color.Blue,Color.BlueViolet }; 38 | Random rand = new Random(); 39 | Color cl = colors[rand.Next(0, colors.Length)]; 40 | return cl; 41 | } 42 | public string getFonts() 43 | { 44 | //自定义字体数组 45 | string[] fonts = { "宋体", "sans-serif" }; 46 | Random rand = new Random(); 47 | string font = fonts[rand.Next(0, fonts.Length)]; 48 | return font; 49 | } 50 | 51 | public void ProcessRequest(HttpContext context) 52 | { 53 | //定义图片的宽度 54 | int ImageWidth = 100; 55 | //定义图片高度 56 | int ImageHeigh = 32; 57 | //定义字体,用于绘制文字 58 | Font font = new Font(getFonts(), 18, FontStyle.Bold); 59 | //定义画笔,用于绘制文字 60 | Color colors = getColor(); 61 | Brush brush = new SolidBrush(colors); 62 | //定义钢笔,用于绘制干扰线 63 | Pen pen = new Pen(getColor(), 0);//这里也可以直接获得一个现有的color对象如:Color.Gold.我是为了美观所以定义和下面一样 64 | //创建一个图像 65 | Bitmap BitImage = new Bitmap(ImageWidth, ImageHeigh); 66 | //从图像获取一个绘画面 67 | Graphics graphics = Graphics.FromImage(BitImage); 68 | //清除整个绘图画面并用颜色填充 69 | graphics.Clear(ColorTranslator.FromHtml("#f7f7f7"));//这里从HTML代码获取color对象 70 | //定义文字的绘制矩形区域 71 | RectangleF rect = new RectangleF(5, 2, ImageWidth, ImageHeigh); 72 | //定义一个随机数对象,用于绘制干扰线 73 | Random rand = new Random(); 74 | //生成两条横向的干扰线 75 | for (int i = 0; i < 2; i++) 76 | { 77 | //定义起点 78 | Point p1 = new Point(0, rand.Next(ImageHeigh)); 79 | //定义终点 80 | Point p2 = new Point(ImageWidth, rand.Next(ImageHeigh)); 81 | //绘制直线 82 | graphics.DrawLine(pen, p1, p2); 83 | } 84 | //生成两条纵向的干扰线 85 | for (int i = 0; i < 2; i++) 86 | { 87 | //定义起点 88 | Point p1 = new Point(rand.Next(ImageWidth), 0); 89 | //定义终点 90 | Point p2 = new Point(rand.Next(ImageWidth), ImageHeigh); 91 | //绘制直线 92 | graphics.DrawLine(pen, p1, p2); 93 | } 94 | //绘制验证码文字 95 | string checkCode = CreateCheckCodeString(); 96 | graphics.DrawString(checkCode, font, brush, rect); 97 | //保存图片为gif格式 98 | BitImage.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png); 99 | //释放对象 100 | graphics.Dispose(); 101 | BitImage.Dispose(); 102 | //context.Session["CheckCode"] = checkCode;//使用cookie存储验证码 103 | string[,] array = new string[1, 2]; 104 | array[0, 0] = "CheckCode"; 105 | array[0, 1] = checkCode; 106 | new Commom.SetCookie().CreateCookie("verifycode", 0, 0, 10, 0, array); 107 | context.Response.Write(checkCode); 108 | } 109 | public bool IsReusable 110 | { 111 | get 112 | { 113 | return false; 114 | } 115 | } 116 | } -------------------------------------------------------------------------------- /Code/account/login.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="account_login" %> 2 | 3 | 4 | 5 | 6 | 欢迎登录!- 信息安全竞赛练习系统 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 |
26 |
27 | 43 |
44 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /Code/account/login.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using Commom; 8 | using Model; 9 | using DAL; 10 | 11 | public partial class account_login : System.Web.UI.Page 12 | { 13 | public string Year = DateTime.Now.Year.ToString(); 14 | public string loginErrorMsg = null; 15 | public string loginUname = null; 16 | public string loginUnameStyle = "logininput"; 17 | public string loginUpwd = null; 18 | public string loginUpwdStyle = "logininput"; 19 | public string loginFocus = "username"; 20 | 21 | public string uisRemember = null; 22 | 23 | public string domain = new settings().getdomain(); 24 | protected void Page_Load(object sender, EventArgs e) 25 | { 26 | #region 脚本时间 27 | if (Year == "2014") 28 | { 29 | Year = "2014"; 30 | } 31 | else 32 | { 33 | Year = "2014-" + Year; 34 | } 35 | #endregion 36 | 37 | 38 | string isSign = "";//是否登录? 39 | if (!string.IsNullOrEmpty(Request.Form["isSign"]))//获取数据类型 40 | { 41 | isSign = Request.Form["isSign"]; 42 | if (isSign == "yes") 43 | { 44 | #region MyRegion 45 | string uname = "";//用户名 46 | if (!string.IsNullOrEmpty(Request.Form["username"]))//获取数据类型 47 | { 48 | uname = Request.Form["username"]; 49 | #region 下一数据 50 | string pwd = "";//密码 51 | if (!string.IsNullOrEmpty(Request.Form["userpwd"]))//获取数据类型 52 | { 53 | pwd = Request.Form["userpwd"]; 54 | #region 下一数据 55 | string isReamber = "";//是否记住密码? 56 | if (!string.IsNullOrEmpty(Request.Form["isRemember"]))//获取数据类型 57 | { 58 | isReamber = Request.Form["isRemember"]; 59 | } 60 | login(isReamber, uname, pwd); 61 | #endregion 62 | } 63 | else 64 | { 65 | loginErrorMsg = "密码不能为空。"; 66 | loginUname = uname; 67 | loginUpwdStyle = "loginError"; 68 | loginFocus = "userpwd"; 69 | } 70 | #endregion 71 | } 72 | else 73 | { 74 | loginErrorMsg = "用户名不能为空。"; 75 | loginUnameStyle = "loginError"; 76 | loginUpwdStyle = "loginError"; 77 | loginFocus = "username"; 78 | } 79 | #endregion 80 | } 81 | } 82 | //第一次加载 83 | if (string.IsNullOrEmpty(isSign)) 84 | { 85 | #region 自动登录 86 | HttpCookie cookies = Request.Cookies["ISReamberAccountCookie"]; 87 | if (cookies != null) 88 | { 89 | loginUname = cookies["username"].ToString(); 90 | loginUpwd = cookies["userpwd"].ToString(); 91 | string isAutoLogin = cookies["isAutoLogin"].ToString(); 92 | if (isAutoLogin == "yes") 93 | { 94 | uisRemember = "checked='checked'"; 95 | login(isAutoLogin, loginUname, loginUpwd); 96 | } 97 | } 98 | #endregion 99 | } 100 | Page.DataBind(); 101 | } 102 | 103 | /// 104 | /// 登录 105 | /// 106 | /// 是否记住 107 | /// 用户名 108 | /// 密码 109 | protected void login(string isReamber, string uname, string pwd) 110 | { 111 | bool isexist = new yonghuDAL().ExistsUserName(uname); 112 | if (isexist == true) 113 | { 114 | yonghuModel yhm = new yonghuDAL().GetModelByUsername(uname); 115 | string pwd2 = new MD5Encrypt().GetMD5(pwd + uname); 116 | if (pwd2 == yhm.nvc_pwd) 117 | { 118 | string[,] array = new string[5, 2]; 119 | array[0, 0] = "username"; 120 | array[0, 1] = yhm.nvc_username; 121 | array[1, 0] = "userpwd"; 122 | array[1, 1] = pwd; 123 | array[2, 0] = "isAutoLogin"; 124 | array[2, 1] = isReamber; 125 | array[3, 0] = "uright"; 126 | array[3, 1] = yhm.int_right.ToString(); 127 | array[4, 0] = "uid"; 128 | array[4, 1] = new MD5Encrypt().GetMD5(uname + yhm.nc_uid); 129 | new SetCookie().CreateCookie("ISAccountCookie", 0, 8, 0, 0, array); 130 | new SetCookie().CreateCookie("ISReamberAccountCookie", 5, 0, 0, 0, array); 131 | Response.Redirect(domain + "/default.aspx"); 132 | } 133 | else 134 | { 135 | loginErrorMsg = "密码错误。"; 136 | loginUname = uname; 137 | loginUpwdStyle = "loginError"; 138 | loginFocus = "userpwd"; 139 | } 140 | } 141 | else 142 | { 143 | loginErrorMsg = "用户名不存在。"; 144 | loginUnameStyle = "loginError"; 145 | loginFocus = "username"; 146 | } 147 | } 148 | } -------------------------------------------------------------------------------- /Code/account/register.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="register" %> 2 | 3 | using System; 4 | using System.Web; 5 | using DAL; 6 | using Model; 7 | using System.Text.RegularExpressions; 8 | 9 | public class register : IHttpHandler 10 | { 11 | 12 | public void ProcessRequest(HttpContext context) 13 | { 14 | context.Response.ContentType = "text/plain"; 15 | 16 | string type = null; 17 | if (!string.IsNullOrEmpty(context.Request.QueryString["type"]))//获取数据类型 18 | { 19 | type = context.Request.QueryString["type"]; 20 | } 21 | #region 用户名 22 | if (type == "username")//用户名 23 | { 24 | string value = context.Request.QueryString["value"]; 25 | bool isexist = new yonghuDAL().ExistsUserName(value); 26 | if (isexist == true) 27 | { 28 | context.Response.Write(1); 29 | } 30 | else 31 | { 32 | context.Response.Write(0); 33 | } 34 | } 35 | #endregion 36 | #region 验证码 37 | if (type == "validate")//验证码 38 | { 39 | HttpCookie cookies = HttpContext.Current.Request.Cookies["verifycode"]; 40 | if (cookies != null && string.IsNullOrEmpty(context.Request.QueryString["value"]) == false)//获取数据值 41 | { 42 | string value = context.Request.QueryString["value"]; 43 | string code = cookies["CheckCode"].ToString().ToString();//session中的验证码 44 | if (code.Equals(value, StringComparison.InvariantCultureIgnoreCase))//比较文本框和session两者中的字符串内容 注意:此处忽略大小 45 | { 46 | context.Response.Write(1); 47 | } 48 | else 49 | { 50 | context.Response.Write(0); 51 | } 52 | } 53 | else 54 | { 55 | context.Response.Write(0); 56 | } 57 | } 58 | #endregion 59 | context.Response.End(); 60 | } 61 | 62 | public bool IsReusable 63 | { 64 | get 65 | { 66 | return false; 67 | } 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /Code/account/register.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="register.aspx.cs" Inherits="account_register" %> 2 | 3 | 4 | 5 | 6 | 创建一个新帐号!- 信息安全竞赛练习系统 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 25 | 26 | 27 |
28 |
29 | 30 | 131 |
132 |
133 | 134 | 135 | -------------------------------------------------------------------------------- /Code/account/register.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using DAL; 8 | using System.Text.RegularExpressions; 9 | using Model; 10 | using Commom; 11 | 12 | public partial class account_register : System.Web.UI.Page 13 | { 14 | protected void Page_Load(object sender, EventArgs e) 15 | { 16 | string caozuo = null; 17 | if (!string.IsNullOrEmpty(Request.Form["action"]))//获取数据类型 18 | { 19 | caozuo = Request.Form["action"]; 20 | } 21 | if (caozuo == "Register") 22 | { 23 | #region 注册 24 | #region 用户名 25 | string uname = null; 26 | if (!string.IsNullOrEmpty(Request.Form["CreateUsername"]))//获取数据类型 27 | { 28 | string un = Request.Form["CreateUsername"]; 29 | if (un.Length > 0 && un.Length <= 20) 30 | { 31 | if (Regex.IsMatch(un, @"^([\u4e00-\u9fa5]|[a-zA-Z]|[0-9]|-){0,}$") || Regex.IsMatch(un, @"^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,4}$")) 32 | { 33 | uname = un; 34 | } 35 | } 36 | } 37 | #endregion 38 | #region 密码 39 | string pwd = null; 40 | if (!string.IsNullOrEmpty(Request.Form["CreatePassword"]))//获取数据类型 41 | { 42 | string up = Request.Form["CreatePassword"]; 43 | if (up.Length > 6 && up.Length <= 16 && up != "123456" && up != "654321" && up != "111222") 44 | { 45 | pwd = up; 46 | } 47 | } 48 | #endregion 49 | #region 重复密码 50 | string repwd = null; 51 | if (!string.IsNullOrEmpty(Request.Form["CreateRePassword"]))//获取数据类型 52 | { 53 | string urd = Request.Form["CreateRePassword"]; 54 | if (urd == pwd) 55 | { 56 | repwd = urd; 57 | } 58 | } 59 | #endregion 60 | #region 操作 61 | string action = null; 62 | if (!string.IsNullOrEmpty(Request.Form["RegisterSubmit"]))//获取数据类型 63 | { 64 | action = Request.Form["RegisterSubmit"]; 65 | } 66 | #endregion 67 | if (pwd == repwd && action == "创建账户" && string.IsNullOrEmpty(uname) != null) 68 | { 69 | 70 | //添加一条记录 71 | yonghuModel yhm = new yonghuModel(); 72 | yhm.nvc_username = uname; 73 | yhm.nvc_pwd = new MD5Encrypt().GetMD5(pwd + uname); 74 | yhm.int_right = 1; 75 | bool isInsertOk = new yonghuDAL().Add(yhm); 76 | 77 | if (isInsertOk == true) 78 | { 79 | Response.Write(""); 80 | } 81 | } 82 | else 83 | { 84 | Response.Write(""); 85 | } 86 | #endregion 87 | Response.End(); 88 | } 89 | Page.DataBind(); 90 | } 91 | } -------------------------------------------------------------------------------- /Code/account/signout.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="signout.aspx.cs" Inherits="account_signout" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 |
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /Code/account/signout.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using Commom; 8 | 9 | public partial class account_signout : System.Web.UI.Page 10 | { 11 | public string domain = new settings().getdomain(); 12 | protected void Page_Load(object sender, EventArgs e) 13 | { 14 | string type = ""; 15 | if (!string.IsNullOrEmpty(Request.Form["type"]))//获取数据类型 16 | { 17 | type = Request.Form["type"]; 18 | } 19 | //清除cookie 20 | if (type == "signout") 21 | { 22 | try 23 | { 24 | HttpCookie aCookie; 25 | string cookieName; 26 | int limit = Request.Cookies.Count; 27 | for (int i = 0; i < limit; i++) 28 | { 29 | cookieName = Request.Cookies[i].Name; 30 | if (cookieName != "ISReamberAccountCookie") 31 | { 32 | aCookie = new HttpCookie(cookieName); 33 | aCookie.Expires = DateTime.Now.AddDays(-365); 34 | Response.Cookies.Add(aCookie); 35 | } 36 | if (cookieName == "ISReamberAccountCookie") 37 | { 38 | HttpCookie cookies = HttpContext.Current.Request.Cookies["ISReamberAccountCookie"]; 39 | string[,] array = new string[5, 2]; 40 | array[0, 0] = "username"; 41 | array[0, 1] = cookies["username"].ToString(); ; 42 | array[1, 0] = "userpwd"; 43 | array[1, 1] = cookies["userpwd"].ToString(); ; 44 | array[2, 0] = "isAutoLogin"; 45 | array[2, 1] = ""; 46 | array[3, 0] = "uright"; 47 | array[3, 1] = cookies["uright"].ToString(); ; 48 | array[4, 0] = "uid"; 49 | array[4, 1] = cookies["uid"].ToString(); ; 50 | new SetCookie().CreateCookie("ISReamberAccountCookie", 5, 0, 0, 0, array); 51 | } 52 | } 53 | Response.Write(1); 54 | } 55 | catch (Exception) 56 | { 57 | Response.Write(0); 58 | } 59 | } 60 | Response.End(); 61 | } 62 | } -------------------------------------------------------------------------------- /Code/css/account/login.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | font-family: Microsoft YaHei; 4 | } 5 | #main 6 | { 7 | left: 0; 8 | top: 0; 9 | position: absolute; 10 | max-width: 1366px; 11 | min-width: 1348px; 12 | width: 100%; 13 | height: 100%; 14 | background: url("../../images/accounts/login_bg.jpg") no-repeat 0 0; 15 | background-size: 100% 100%; 16 | } 17 | #header 18 | { 19 | left: 50%; 20 | top: 50%; 21 | position: absolute; 22 | width: 330px; 23 | height: 100px; 24 | background: url("../../image/logo.png") no-repeat 0 0; 25 | margin-left: -145px; 26 | margin-top: -100px; 27 | } 28 | #header a 29 | { 30 | margin: 0; 31 | width: 330px; 32 | height: 100px; 33 | float: left; 34 | } 35 | #foot 36 | { 37 | height: 60px; 38 | line-height: 60px; 39 | width: 100%; 40 | overflow: hidden; 41 | color: #eee; 42 | position: absolute; 43 | bottom: 0; 44 | left: 0; 45 | z-index: 0; 46 | text-shadow: 0px 1px 1px #000; 47 | font-size: 14px; 48 | text-align: center; 49 | } 50 | #foot a 51 | { 52 | color:#eee; 53 | font-size:14px; 54 | text-decoration:none; 55 | } 56 | #foot a:hover 57 | { 58 | text-decoration:underline; 59 | } 60 | #login 61 | { 62 | height: 88px; 63 | width: 100%; 64 | color: #fff; 65 | position: absolute; 66 | bottom: 60px; 67 | left: 0; 68 | z-index: 1; 69 | } 70 | .login-inner 71 | { 72 | line-height: 20px; 73 | width: 560px; 74 | height: 88px; 75 | overflow: visible; 76 | margin: 0 auto; 77 | position: relative; 78 | top: 0px; 79 | text-align: center; 80 | white-space: nowrap; 81 | } 82 | #login input[type="password"], input[type="text"] 83 | { 84 | background: rgba(68, 68, 68, .6); 85 | border-radius: 5px; 86 | box-shadow: inset 0px 0px 8px rgba(0, 0, 0, 0.4); 87 | height: 38px; 88 | width: 200px; 89 | z-index: 1; 90 | padding-left: 15px; 91 | color: #ffffff; 92 | font-size: 18px; 93 | outline-color: #bf0b10; 94 | } 95 | .logininput 96 | { 97 | border: 1px solid #ddd; 98 | } 99 | .loginError 100 | { 101 | border: 1px solid #bf0b10; 102 | } 103 | #login-help 104 | { 105 | margin:0; 106 | width: 560px; 107 | height: 40px; 108 | line-height:40px; 109 | } 110 | #login-help input[type=checkbox] 111 | { 112 | margin-left:15px; 113 | margin-top:13px; 114 | float:left; 115 | -webkit-appearance: none; 116 | display: inline-block; 117 | width: 14px; 118 | height: 14px; 119 | cursor: pointer; 120 | vertical-align: middle; 121 | background: url(../../images/accounts/checkbox_login_0.png) no-repeat 0 0; 122 | border: 0; 123 | outline: none; 124 | } 125 | #login-help input[type=checkbox]:checked 126 | { 127 | -webkit-appearance: none; 128 | display: inline-block; 129 | background: url(../../images/accounts/checkbox_login_1.png) no-repeat 0 0; 130 | border: 0; 131 | outline: none; 132 | width: 14px; 133 | height: 14px; 134 | } 135 | #login-help span 136 | { 137 | float:left; 138 | text-align:left; 139 | color:#eee; 140 | font-size:14px; 141 | } 142 | #login-help a 143 | { 144 | float:left; 145 | margin-left:135px; 146 | text-align:left; 147 | color:#eee; 148 | font-size:14px; 149 | text-decoration:none; 150 | } 151 | #login-help a:hover 152 | { 153 | color:#fff; 154 | text-decoration:underline; 155 | } 156 | .formSubmit 157 | { 158 | margin-top: 0; 159 | margin-left: 10px; 160 | width: 80px; 161 | height: 40px; 162 | line-height: 38px; 163 | border: 1px solid #850e11; 164 | background: #bf0b10; 165 | color: #fff; 166 | font-size: 16px; 167 | cursor: pointer; 168 | border-radius: 5px; 169 | } 170 | .formSubmit:hover 171 | { 172 | background: #d20c12; 173 | } 174 | -------------------------------------------------------------------------------- /Code/css/account/register.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | font-family: verdana,sans-serif; 4 | background: transparent; 5 | } 6 | .account 7 | { 8 | left: 0; 9 | right: 0; 10 | top: 0; 11 | bottom: 0; 12 | margin: 0; 13 | float: left; 14 | position: absolute; 15 | 16 | min-width: 1330px; 17 | } 18 | .account-head 19 | { 20 | margin-left: 0; 21 | width: 100%; 22 | top: 0; 23 | height: 60px; 24 | background: #f2f2f2; 25 | position: absolute; 26 | } 27 | .account-head-schoollogo 28 | { 29 | float: left; 30 | margin-left: 50px; 31 | height: 60px; 32 | line-height: 60px; 33 | background: url("../../image/logo.gif") no-repeat 0 5px; 34 | width: 320px; 35 | } 36 | .account-head-logo 37 | { 38 | margin:0; 39 | float: left; 40 | height: 60px; 41 | line-height: 60px; 42 | background: url("../../image/logo.gif") no-repeat -320px 5px; 43 | width: 150px; 44 | } 45 | #newStudent 46 | { 47 | float: right; 48 | margin-right: 50px; 49 | height: 59px; 50 | line-height: 59px; 51 | width: 115px; 52 | font-size: 18px; 53 | text-decoration: none; 54 | color: #26AB52; 55 | } 56 | #newStudent:hover 57 | { 58 | text-decoration: underline; 59 | } 60 | .account-main 61 | { 62 | margin: 0; 63 | position: absolute; 64 | top: 60px; 65 | width: 100%; 66 | height: 580px; 67 | float: left; 68 | border-top: #E0E0E0 1px solid; 69 | } 70 | .account-login-register 71 | { 72 | margin-top: 14px; 73 | margin-left: 100px; 74 | margin-right: 100px; 75 | height: 550px; 76 | float: left; 77 | } 78 | .account-login 79 | { 80 | margin-left: 100px; 81 | float: left; 82 | width: 400px; 83 | height: 450px; 84 | border: 1px solid #eee; 85 | -webkit-border-radius: 6px; /* border-radius: 2px; */ 86 | -moz-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 87 | -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 88 | box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 89 | background: #F7F7F6; 90 | } 91 | .account-login-p 92 | { 93 | margin: 0; 94 | margin-left: -2px; 95 | margin-right: -2px; 96 | height: 42px; 97 | width: 404px; 98 | -webkit-border-top-left-radius: 6px; 99 | border-top-left-radius: 6px; 100 | -webkit-border-top-right-radius: 6px; 101 | border-top-right-radius: 6px; 102 | background-color: #4d90fe; 103 | background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed); 104 | } 105 | .account-login-p-span 106 | { 107 | margin: 0; 108 | height: 42px; 109 | line-height: 42px; 110 | float: left; 111 | color: #fff; 112 | padding-left: 20px; 113 | font-family: Microsoft YaHei; 114 | } 115 | .account-login-image 116 | { 117 | margin: 0; 118 | height: 113px; 119 | width: 400px; 120 | margin-top: 17px; 121 | } 122 | .account-login-image-img 123 | { 124 | width: 96px; 125 | height: 96px; 126 | display: block; 127 | margin: auto; 128 | vertical-align: middle; 129 | -moz-border-radius: 50%; 130 | -webkit-border-radius: 50%; 131 | border-radius: 50%; 132 | } 133 | .account-login-card 134 | { 135 | margin: 0 40px 0 40px; 136 | width: 320px; 137 | height: 280px; 138 | } 139 | .account-login-card-label 140 | { 141 | margin: 0; 142 | color: #222; 143 | font-weight: bold; 144 | height: 32px; 145 | width: 320px; 146 | line-height: 32px; 147 | font-size: 13px; 148 | padding-left: 3px; 149 | } 150 | .account-login-card-input 151 | { 152 | margin: 0; 153 | color: #404040; 154 | height: 42px; 155 | width: 320px; 156 | line-height: 42px; 157 | -webkit-appearance: none; 158 | appearance: none; 159 | display: inline-block; 160 | padding: 0 8px; 161 | background: #fff; 162 | border: 1px solid #c0c0c0; 163 | -moz-box-sizing: border-box; 164 | -webkit-box-sizing: border-box; 165 | box-sizing: border-box; 166 | -moz-border-radius: 1px; 167 | -webkit-border-radius: 1px; 168 | border-radius: 1px; 169 | font-size: 15px; 170 | color: #404040; 171 | vertical-align: middle; 172 | } 173 | .account-login-card-input-error 174 | { 175 | margin: 0; 176 | color: #404040; 177 | height: 42px; 178 | width: 320px; 179 | line-height: 42px; 180 | -webkit-appearance: none; 181 | appearance: none; 182 | display: inline-block; 183 | padding: 0 8px; 184 | background: #fff; 185 | border: 1px solid #dd4b39; 186 | -moz-box-sizing: border-box; 187 | -webkit-box-sizing: border-box; 188 | box-sizing: border-box; 189 | -moz-border-radius: 1px; 190 | -webkit-border-radius: 1px; 191 | border-radius: 1px; 192 | font-size: 15px; 193 | color: #404040; 194 | vertical-align: middle; 195 | } 196 | .account-login-card-span-error 197 | { 198 | margin: 0; 199 | color: #dd4b39; 200 | height: 32px; 201 | width: 320px; 202 | line-height: 32px; 203 | font-size: 13px; 204 | padding-left: 3px; 205 | } 206 | .account-login-button-sumbit 207 | { 208 | margin: 0; 209 | color: #fff; 210 | height: 36px; 211 | width: 320px; 212 | line-height: 36px; 213 | font-size: 14px; 214 | font-weight: 700; 215 | border: 1px solid #3079ed; 216 | text-shadow: 0 1px rgba(0,0,0,0.1); 217 | background-color: #4d90fe; 218 | background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed); 219 | -webkit-border-radius: 3px; 220 | border-radius: 3px; 221 | } 222 | .account-login-button-sumbit:hover 223 | { 224 | border: 1px solid #2f5bb7; 225 | color: #fefefe; 226 | text-shadow: 0 1px rgba(0,0,0,0.3); 227 | background-color: #357ae8; 228 | background-image: -webkit-linear-gradient(top,#4d90fe,#357ae8); 229 | background-image: -moz-linear-gradient(top,#4d90fe,#357ae8); 230 | background-image: -ms-linear-gradient(top,#4d90fe,#357ae8); 231 | background-image: -o-linear-gradient(top,#4d90fe,#357ae8); 232 | background-image: linear-gradient(top,#4d90fe,#357ae8); 233 | } 234 | .account-login-remember 235 | { 236 | margin: 0; 237 | width: 320px; 238 | height: 18px; 239 | line-height: 18px; 240 | font-size: 12px; 241 | } 242 | input[type=checkbox] 243 | { 244 | -webkit-appearance: none; 245 | display: inline-block; 246 | width: 14px; 247 | height: 14px; 248 | margin: 0; 249 | margin-top: -2px; 250 | cursor: pointer; 251 | vertical-align: middle; 252 | background: url(../../images/accounts/checkbox_login_0.png) no-repeat 0 0; 253 | border: 0; 254 | outline: none; 255 | } 256 | input[type=checkbox]:checked 257 | { 258 | margin: 0; 259 | margin-top: -2px; 260 | -webkit-appearance: none; 261 | display: inline-block; 262 | background: url(../../images/accounts/checkbox_login_1.png) no-repeat 0 0; 263 | border: 0; 264 | outline: none; 265 | width: 14px; 266 | height: 14px; 267 | } 268 | input[type=checkbox]:hover 269 | { 270 | border-color: #c6c6c6; 271 | -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); 272 | -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); 273 | box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); 274 | } 275 | .remember .bubble-wrap 276 | { 277 | position: absolute; 278 | padding-top: 3px; 279 | -o-transition: opacity .218s ease-in .218s; 280 | -moz-transition: opacity .218s ease-in .218s; 281 | -webkit-transition: opacity .218s ease-in .218s; 282 | transition: opacity .218s ease-in .218s; 283 | left: -999em; 284 | opacity: 0; 285 | width: 314px; 286 | margin-left: -20px; 287 | } 288 | .remember:hover .bubble-wrap, .remember input:focus .bubble-wrap, .remember .bubble-wrap:hover, .remember .bubble-wrap:focus 289 | { 290 | opacity: 1; 291 | left: inherit; 292 | } 293 | .bubble-pointer 294 | { 295 | border-left: 10px solid transparent; 296 | border-right: 10px solid transparent; 297 | border-bottom: 10px solid #fff; 298 | width: 0; 299 | height: 0; 300 | margin-left: 17px; 301 | } 302 | .bubble 303 | { 304 | background-color: #fff; 305 | padding: 15px; 306 | margin-top: -1px; 307 | font-size: 11px; 308 | -moz-border-radius: 2px; 309 | -webkit-border-radius: 2px; 310 | border-radius: 2px; 311 | -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); 312 | -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); 313 | box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); 314 | } 315 | .dasher-tooltip 316 | { 317 | position: absolute; 318 | left: 50%; 319 | top: 380px; 320 | margin-left: 150px; 321 | } 322 | .dasher-tooltip .tooltip-pointer 323 | { 324 | margin-top: 15px; 325 | } 326 | .dasher-tooltip p 327 | { 328 | margin-top: 0; 329 | } 330 | .dasher-tooltip p span 331 | { 332 | display: block; 333 | } 334 | a:hover 335 | { 336 | text-decoration: underline; 337 | } 338 | a, a:hover, a:visited 339 | { 340 | color: #427fed; 341 | cursor: pointer; 342 | text-decoration: none; 343 | } 344 | a, a:hover, a:visited 345 | { 346 | color: #427fed; 347 | cursor: pointer; 348 | text-decoration: none; 349 | } 350 | .need-help-reverse 351 | { 352 | float: right; 353 | margin: 0; 354 | font-size: 12px; 355 | } 356 | .need-help-reverse:hover 357 | { 358 | text-decoration: underline; 359 | } 360 | a, a:hover, a:visited 361 | { 362 | color: #427fed; 363 | cursor: pointer; 364 | text-decoration: none; 365 | } 366 | user agent stylesheeta:-webkit-any-link 367 | { 368 | color: -webkit-link; 369 | text-decoration: underline; 370 | cursor: auto; 371 | } 372 | .account-register 373 | { 374 | margin-left: 50px; 375 | float: left; 376 | width: 520px; 377 | height: 550px; 378 | border: 1px solid #eee; 379 | -webkit-border-radius: 6px; /* border-radius: 2px; */ 380 | -moz-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 381 | -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 382 | box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 383 | background: #F7F7F6; 384 | } 385 | .account-register-p 386 | { 387 | margin: 0; 388 | margin-left: -2px; 389 | margin-right: -2px; 390 | height: 42px; 391 | width: 524px; 392 | -webkit-border-top-left-radius: 6px; 393 | border-top-left-radius: 6px; 394 | -webkit-border-top-right-radius: 6px; 395 | border-top-right-radius: 6px; 396 | background-color: #00a600; 397 | background-image: -webkit-linear-gradient(top,#00a600,#00a600); 398 | } 399 | .account-register-p-span 400 | { 401 | margin: 0; 402 | height: 42px; 403 | line-height: 42px; 404 | float: left; 405 | color: #fff; 406 | padding-left: 20px; 407 | font-family: Microsoft YaHei; 408 | } 409 | .account-register-card 410 | { 411 | margin-left: 10px; 412 | width: 495px; 413 | float: left; 414 | } 415 | .account-register-card-label 416 | { 417 | margin: 0; 418 | color: #222; 419 | font-weight: bold; 420 | height: 26px; 421 | width: 495px; 422 | line-height: 26px; 423 | font-size: 13px; 424 | padding-left: 3px; 425 | } 426 | .account-register-card-input 427 | { 428 | margin: 0; 429 | color: #404040; 430 | height: 32px; 431 | width: 495px; 432 | line-height: 32px; 433 | -webkit-appearance: none; 434 | appearance: none; 435 | display: inline-block; 436 | padding: 0 8px; 437 | background: #fff; 438 | border: 1px solid #c0c0c0; 439 | -moz-box-sizing: border-box; 440 | -webkit-box-sizing: border-box; 441 | box-sizing: border-box; 442 | -moz-border-radius: 1px; 443 | -webkit-border-radius: 1px; 444 | border-radius: 1px; 445 | font-size: 13px; 446 | color: #404040; 447 | vertical-align: middle; 448 | -webkit-border-radius: 3px; 449 | border-radius: 3px; 450 | float: left; 451 | } 452 | .account-register-span 453 | { 454 | margin: 0; 455 | height: 14px; 456 | line-height: 14px; 457 | padding-left: 8px; 458 | padding-right: 8px; 459 | color: #888; 460 | font-size: 12px; 461 | float: left; 462 | } 463 | .account-register-span-error 464 | { 465 | margin: 0; 466 | height: 14px; 467 | line-height: 14px; 468 | padding-left: 8px; 469 | padding-right: 8px; 470 | color: #C00; 471 | font-size: 12px; 472 | float: left; 473 | } 474 | .account-register-error 475 | { 476 | background: url("../../images/accounts/glb.png") no-repeat -42px -2px; 477 | margin: 0; 478 | height: 14px; 479 | width: 14px; 480 | float: left; 481 | } 482 | .account-register-span-right 483 | { 484 | margin: 0; 485 | height: 14px; 486 | line-height: 14px; 487 | padding-left: 8px; 488 | padding-right: 8px; 489 | color: #3D882D; 490 | font-size: 12px; 491 | float: left; 492 | } 493 | .account-register-right 494 | { 495 | background: url("../../images/accounts/glb.png") no-repeat -6px -2px; 496 | margin: 0; 497 | height: 14px; 498 | width: 14px; 499 | float: left; 500 | } 501 | .account-register-agree-span 502 | { 503 | color: #888; 504 | font-size: 12px; 505 | } 506 | em 507 | { 508 | width: 106px; 509 | height: 14px; 510 | vertical-align: top; 511 | font-size: 12px; 512 | } 513 | em i 514 | { 515 | text-align: center; 516 | height: 14px; 517 | line-height: 14px; 518 | display: inline-block; 519 | font-style: normal; 520 | color: #fff; 521 | vertical-align: top; 522 | } 523 | em i.w1 524 | { 525 | width: 26px; 526 | background: url(../../images/accounts/password_safe.png) no-repeat 0 -18px; 527 | } 528 | em i.w2 529 | { 530 | width: 54px; 531 | background: url(../../images/accounts/password_safe.png) no-repeat 0 -32px; 532 | } 533 | em i.w3 534 | { 535 | width: 78px; 536 | background: url(../../images/accounts/password_safe.png) no-repeat 0 -46px; 537 | } 538 | em i.w4 539 | { 540 | width: 106px; 541 | background: url(../../images/accounts/password_safe.png) no-repeat 0 -60px; 542 | } 543 | #imgOK 544 | { 545 | margin: 0; 546 | float: left; 547 | height: 40px; 548 | line-height: 40px; 549 | margin-top: -5px; 550 | margin-left: 5px; 551 | } 552 | #codeImg 553 | { 554 | font-size: 12px; 555 | height: 40px; 556 | line-height: 40px; 557 | margin: 0; 558 | float: left; 559 | margin-left: 5px; 560 | margin-top: -5px; 561 | } 562 | #codeImg:hover 563 | { 564 | text-decoration: underline; 565 | } 566 | .account-register-button-sumbit 567 | { 568 | margin: 0; 569 | color: #fff; 570 | height: 36px; 571 | width: 495px; 572 | line-height: 36px; 573 | vertical-align: middle; 574 | font-size: 14px; 575 | font-weight: 700; 576 | border: 1px solid #51a351; 577 | text-shadow: 0 1px rgba(0,0,0,0.1); 578 | background-color: #5bb75b; 579 | background-image: -webkit-linear-gradient(top, #62c462, #51a351)); 580 | -webkit-border-radius: 3px; 581 | border-radius: 3px; 582 | } 583 | .account-register-button-sumbit:hover 584 | { 585 | border: 1px solid #51a351; 586 | color: #fefefe; 587 | text-shadow: 0 1px rgba(0,0,0,0.3); 588 | background-color: #51a351; 589 | } 590 | .registeragree:hover 591 | { 592 | text-decoration: underline; 593 | } 594 | .account-foot 595 | { 596 | top: 640px; 597 | width: 100%; 598 | height: 39px; 599 | position: absolute; 600 | font-size: 13px; 601 | color: #555; 602 | background: #f2f2f2; 603 | border-top: #E0E0E0 1px solid; 604 | border-bottom: #E0E0E0 1px solid; 605 | font-family: Microsoft YaHei; 606 | } 607 | .account-foot-left 608 | { 609 | text-align: left; 610 | height: 40px; 611 | line-height: 40px; 612 | float: left; 613 | margin-left: 100px; 614 | } 615 | .account-foot-right 616 | { 617 | text-align: right; 618 | height: 40px; 619 | line-height: 40px; 620 | float: right; 621 | margin-right: 100px; 622 | } 623 | 624 | 625 | .SelectMenu 626 | { 627 | top: 268px; 628 | left: 665px; 629 | position: absolute; 630 | width: 495px; 631 | z-index: 100; 632 | background-color: #fff; 633 | scrollbar-face-color: #FFFFFF; 634 | scrollbar-shadow-color: #D2E5F4; 635 | scrollbar-highlight-color: #D2E5F4; 636 | scrollbar-3dlight-color: #FFFFFF; 637 | scrollbar-darkshadow-color: #FFFFFF; 638 | scrollbar-track-color: #FFFFFF; 639 | scrollbar-arrow-color: #D2E5F4; 640 | } 641 | .SelectMenu ul 642 | { 643 | list-style: none; 644 | margin: 0; 645 | padding: 0; 646 | border-left: 1px solid #bbb; 647 | border-right: 1px solid #bbb; 648 | border-bottom: 1px solid #bbb; 649 | width: 495px; 650 | } 651 | .SelectMenu li 652 | { 653 | list-style: none; 654 | font-size: 12px; 655 | border-bottom: 1px solid #eee; 656 | height: 25px; 657 | line-height: 25px; 658 | padding: 0 0 0 5px; 659 | } 660 | .SelectMenu li:hover 661 | { 662 | list-style: none; 663 | font-size: 12px; 664 | border-bottom: 1px solid #eee; 665 | height: 25px; 666 | line-height: 25px; 667 | padding: 0 0 0 5px; 668 | background-color: #ccc; 669 | cursor: pointer; 670 | } 671 | 672 | -------------------------------------------------------------------------------- /Code/css/default.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | body 3 | { 4 | font-family:Microsoft YaHei; 5 | background: url(../images/background.jpg) no-repeat center top fixed; 6 | background-size: 100% 100%; 7 | left: 0; 8 | right: 0; 9 | top: 0; 10 | bottom:0; 11 | position: fixed; 12 | min-width:1340px; 13 | height: auto; 14 | margin: 0; 15 | font-size:13px; 16 | } 17 | .inform 18 | { 19 | left: 0px; 20 | right: 0px; 21 | top: 10px; 22 | position: fixed; 23 | height:40px; 24 | line-height:40px; 25 | } 26 | .inform a 27 | { 28 | margin:0; 29 | margin-right:100px; 30 | float:right; 31 | height: 40px; 32 | line-height: 40px; 33 | font-size: 15px; 34 | color: #999; 35 | color: #fff; 36 | text-decoration:none; 37 | } 38 | .inform a:hover 39 | { 40 | color:#FF0; 41 | } 42 | .inform a i { 43 | margin:0; 44 | margin-top:4px; 45 | float: left; 46 | width: 32px; 47 | height: 32px; 48 | overflow: hidden; 49 | border-radius: 50%; 50 | box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); 51 | } 52 | .inform a i img { 53 | margin:0; 54 | width: 32px; 55 | height: 32px; 56 | } 57 | .inform a span { 58 | margin:0; 59 | padding:0 5px 0 10px; 60 | width: 40px; 61 | height: 40px; 62 | } 63 | .inform a s 64 | { 65 | margin:0; 66 | margin-top:8px; 67 | float:right; 68 | width: 24px; 69 | height: 24px; 70 | background-image: url(../images/inform-ico.png); 71 | background-repeat: no-repeat; 72 | background-position: 0 0; 73 | } 74 | .inform a:hover s 75 | { 76 | background-position: 0 -24px; 77 | } 78 | .informmenu 79 | { 80 | top: 50px; 81 | right: 94px; 82 | width: 80px; 83 | height: 135px; 84 | border: 1px solid rgb(227, 227, 227); 85 | position: fixed; 86 | -webkit-border-radius: 3px; 87 | -moz-border-radius: 3px; 88 | -border-radius: 3px; 89 | background: rgb(255, 255, 255); 90 | z-index:2000; 91 | display:none; 92 | } 93 | .informmenu b 94 | { 95 | margin: 0; 96 | float:left; 97 | height: 7px; 98 | margin-top: -7px; 99 | width: 100%; 100 | background: url('../images/list-top.png') no-repeat 55px -1px; 101 | } 102 | .informmenu a 103 | { 104 | margin: 0; 105 | margin-top:4px; 106 | padding-left: 0px; 107 | padding-right: 0px; 108 | padding:2px 0; 109 | float:left; 110 | height:24px; 111 | line-height:24px; 112 | width:100%; 113 | color: #888; 114 | text-align:center; 115 | } 116 | .informmenu a:hover 117 | { 118 | background: #2b91e3; 119 | color: #fff; 120 | } 121 | 122 | 123 | .wrapper 124 | { 125 | left: 70px; 126 | right: 70px; 127 | top: 60px; 128 | bottom:60px; 129 | position: fixed; 130 | background: rgba(255, 255, 255, 0.8); 131 | -webkit-border-radius: 8px; 132 | -moz-border-radius: 8px; 133 | -border-radius: 8px; 134 | z-index:-1; 135 | } 136 | .wrapper .btn 137 | { 138 | position:absolute; 139 | left: 50px; 140 | right: 50px; 141 | top: 20px; 142 | bottom:10px; 143 | } 144 | .wrapper .btn ul { 145 | margin: 0; 146 | padding: 0; 147 | display: inline-block; 148 | width:100%; 149 | height:100%; 150 | } 151 | .wrapper .btn ul li { 152 | margin: 0; 153 | float:left; 154 | margin-top:36px; 155 | width: 25%; 156 | height:204px; 157 | overflow: hidden; 158 | list-style-type: none; 159 | } 160 | .wrapper .btn ul a { 161 | position: relative; 162 | display: block; 163 | width: 128px; 164 | height: 128px; 165 | margin: auto; 166 | border-radius: 24px; 167 | background-repeat: no-repeat; 168 | -webkit-transition: box-shadow 0.3s ease; 169 | -moz-transition: box-shadow 0.3s ease; 170 | -ms-transition: box-shadow 0.3s ease; 171 | } 172 | .btn-shunxu 173 | { 174 | background-image: url(../images/ico/shunxu.png); 175 | } 176 | .btn-suiji 177 | { 178 | background-image: url(../images/ico/suiji.png); 179 | } 180 | .btn-cuowu 181 | { 182 | background-image: url(../images/ico/cuowu.png); 183 | } 184 | .btn-shoucang 185 | { 186 | background-image: url(../images/ico/shoucang.png); 187 | } 188 | .btn-kaoshi 189 | { 190 | background-image: url(../images/ico/kaoshi.png); 191 | } 192 | .btn-kaoshijilu 193 | { 194 | background-image: url(../images/ico/kaoshijilu.png); 195 | } 196 | .wrapper .btn ul a span { 197 | position: absolute; 198 | top: 150px; 199 | left: 19px; 200 | width: 90px; 201 | height: 24px; 202 | line-height: 24px; 203 | text-align: center; 204 | font-size: 22px; 205 | color: #444; 206 | } 207 | 208 | .footer 209 | { 210 | position:fixed; 211 | left: 70px; 212 | right: 70px; 213 | bottom:0px; 214 | position: fixed; 215 | height: 60px; 216 | line-height: 60px; 217 | color: #333; 218 | font-size: 15px; 219 | text-align: center; 220 | z-index: 1000; 221 | } 222 | .footer a 223 | { 224 | color: #333; 225 | font-size: 15px; 226 | text-decoration:none; 227 | } 228 | .footer a:hover 229 | { 230 | text-decoration:underline; 231 | } -------------------------------------------------------------------------------- /Code/css/kaoshi.css: -------------------------------------------------------------------------------- 1 | /* CSS Document */ 2 | @charset "utf-8"; 3 | @import url(main.css);/*样式*/ 4 | .wrapper 5 | { 6 | margin:auto; 7 | width:1200px; 8 | } 9 | .timu 10 | { 11 | position:relative; 12 | top:5px; 13 | left:0; 14 | right:0; 15 | height:350px; 16 | display: inline; 17 | font-size:16px; 18 | font-weight:700; 19 | } 20 | .timu .broder 21 | { 22 | padding: 10px; 23 | width:1178px; 24 | height:328px; 25 | border: 1px solid #ddd; 26 | -webkit-border-radius: 3px; 27 | -moz-border-radius: 3px; 28 | -border-radius: 3px; 29 | } 30 | .timu .timucontent 31 | { 32 | width:100%; 33 | line-height:28px; 34 | display: inline-block; 35 | } 36 | .timu .timucontent span 37 | { 38 | margin:0; 39 | width:1178px; 40 | height:auto; 41 | float:left; 42 | } 43 | .timu .timuoptions { 44 | margin: 0; 45 | margin-top:5px; 46 | margin-left: 38px; 47 | padding: 0; 48 | display: inline-block; 49 | width: 1040px; 50 | max-width: 1040px; 51 | text-align: left; 52 | } 53 | .timu .timuoptions li { 54 | margin: 0; 55 | padding:15px 0 0 0; 56 | overflow: hidden; 57 | list-style-type: none; 58 | } 59 | .timu .select 60 | { 61 | position:absolute; 62 | bottom:0px; 63 | left:0px; 64 | height:40px; 65 | line-height:40px; 66 | width:100%; 67 | font-size:18px; 68 | } 69 | .timu .select .selectdaan 70 | { 71 | margin:0; 72 | float:left; 73 | width:300px; 74 | } 75 | .redfont 76 | { 77 | color:Red; 78 | font-weight:700; 79 | } 80 | .timu .select .selectoptions 81 | { 82 | margin:0; 83 | float:left; 84 | margin-left:15px; 85 | min-width:500px; 86 | max-width:500px; 87 | text-align:left; 88 | } 89 | .timu .select .selectbtn 90 | { 91 | margin:0; 92 | float:right; 93 | margin-right:15px; 94 | min-width:330px; 95 | max-width:330px; 96 | text-align:right; 97 | } 98 | .timu .select .selectbtn .btnwidth 99 | { 100 | width:80px; 101 | font-size:15px; 102 | } 103 | input[type="button"] { 104 | margin: 0; 105 | padding: 0; 106 | height: 26px; 107 | width: 55px; 108 | font-size:16px; 109 | align-items: flex-start; 110 | text-align: center; 111 | cursor: pointer; 112 | border: 2px outset buttonface; 113 | font-family: "新宋体","Arial"; 114 | } 115 | 116 | 117 | .tihao 118 | { 119 | position:relative; 120 | top:10px; 121 | width:100%; 122 | } 123 | .tihao .table1 124 | { 125 | margin: 0; 126 | white-space: normal; 127 | table-layout: fixed; 128 | display: table; 129 | font-weight: 100; 130 | } 131 | 132 | .tihao .table1 tr 133 | { 134 | display: table-row; 135 | } 136 | .tihao .table1 tr td 137 | { 138 | margin: 0; 139 | padding:0; 140 | width: 44px; 141 | height: 30px; 142 | border: 1px solid #bbb; 143 | vertical-align: top; 144 | } 145 | .tihao .table1 tr td a 146 | { 147 | margin: 0; 148 | padding:0; 149 | width:100%; 150 | float: left; 151 | text-align: center; 152 | overflow: hidden; 153 | -text-overflow: ellipsis; 154 | text-decoration:none; 155 | color: #444; 156 | } 157 | .tihao .table1 tr td span 158 | { 159 | margin: 0; 160 | width:100%; 161 | float: left; 162 | text-align: center; 163 | overflow: hidden; 164 | -text-overflow: ellipsis; 165 | font-size:12px; 166 | height:15px; 167 | line-height:15px; 168 | } 169 | .tihao .table1 tr td b 170 | { 171 | margin: 0; 172 | width:100%; 173 | float: left; 174 | text-align: left; 175 | overflow: hidden; 176 | -text-overflow: ellipsis; 177 | font-size:12px; 178 | height:15px; 179 | line-height:15px; 180 | } 181 | .currentbg 182 | { 183 | background:url(../images/currentbg.png) repeat-x 0 0; 184 | } 185 | .rightbg 186 | { 187 | background:#66FF66; 188 | } 189 | .errorbg 190 | { 191 | background:#FF0000; 192 | } 193 | .jishi 194 | { 195 | position:fixed; 196 | right:10px; 197 | top:80px; 198 | height:98px; 199 | width:98px; 200 | background-color:white; 201 | border: #ddd 1px solid; 202 | color: #455469; 203 | text-align:center; 204 | -webkit-border-radius: 5px; 205 | -border-radius: 5px; 206 | font-family:Microsoft YaHei; 207 | } 208 | .jishi p 209 | { 210 | margin:0; 211 | padding:10px 0 0 0; 212 | float:left; 213 | width:100%; 214 | height:28px; 215 | line-height:28px; 216 | display: block; 217 | -webkit-margin-before: 0em; 218 | -webkit-margin-after: 0em; 219 | -webkit-margin-start: 0px; 220 | -webkit-margin-end: 0px; 221 | font-size:20px; 222 | } 223 | .jishi h1 224 | { 225 | margin:0; 226 | float:left; 227 | width:100%; 228 | height:60px; 229 | line-height:60px; 230 | display: block; 231 | -webkit-margin-before: 0em; 232 | -webkit-margin-after: 0em; 233 | -webkit-margin-start: 0px; 234 | -webkit-margin-end: 0px; 235 | font-size:26px; 236 | font-weight:100; 237 | } -------------------------------------------------------------------------------- /Code/css/lianxi.css: -------------------------------------------------------------------------------- 1 | /* CSS Document */ 2 | @charset "utf-8"; 3 | @import url(main.css);/*样式*/ 4 | .wrapper 5 | { 6 | margin:auto; 7 | width:1200px; 8 | } 9 | .timu 10 | { 11 | position:relative; 12 | top:5px; 13 | left:0; 14 | right:0; 15 | height:350px; 16 | display: inline; 17 | font-size:16px; 18 | font-weight:700; 19 | } 20 | .timu .broder 21 | { 22 | padding: 10px; 23 | width:1178px; 24 | height:328px; 25 | border: 1px solid #ddd; 26 | -webkit-border-radius: 3px; 27 | -moz-border-radius: 3px; 28 | -border-radius: 3px; 29 | } 30 | .timu .timucontent 31 | { 32 | width:100%; 33 | line-height:28px; 34 | display: inline-block; 35 | } 36 | .timu .timucontent span 37 | { 38 | margin:0; 39 | width:1178px; 40 | height:auto; 41 | float:left; 42 | } 43 | .timu .timuoptions { 44 | margin: 0; 45 | margin-top:5px; 46 | margin-left: 38px; 47 | padding: 0; 48 | display: inline-block; 49 | width: 1040px; 50 | max-width: 1040px; 51 | text-align: left; 52 | } 53 | .timu .timuoptions li { 54 | margin: 0; 55 | padding:15px 0 0 0; 56 | overflow: hidden; 57 | list-style-type: none; 58 | } 59 | .timu .select 60 | { 61 | position:absolute; 62 | bottom:0px; 63 | left:0px; 64 | height:40px; 65 | line-height:40px; 66 | width:100%; 67 | font-size:18px; 68 | } 69 | .timu .select .selectdaan 70 | { 71 | margin:0; 72 | float:left; 73 | width:230px; 74 | } 75 | .timu .select .rightdaan 76 | { 77 | margin:0; 78 | float:left; 79 | width:180px; 80 | } 81 | .redfont 82 | { 83 | color:Red; 84 | font-weight:700; 85 | } 86 | .timu .select .selectoptions 87 | { 88 | margin:0; 89 | float:left; 90 | margin-left:15px; 91 | min-width:450px; 92 | max-width:450px; 93 | text-align:left; 94 | } 95 | .timu .select .selectbtn 96 | { 97 | margin:0; 98 | float:right; 99 | margin-right:15px; 100 | min-width:300px; 101 | max-width:300px; 102 | text-align:right; 103 | } 104 | .timu .select .selectbtn .btnwidth 105 | { 106 | width:80px; 107 | font-size:15px; 108 | } 109 | input[type="button"] { 110 | margin: 0; 111 | padding: 0; 112 | height: 26px; 113 | width: 55px; 114 | font-size:16px; 115 | align-items: flex-start; 116 | text-align: center; 117 | cursor: pointer; 118 | border: 2px outset buttonface; 119 | font-family: "新宋体","Arial"; 120 | } 121 | input[type=checkbox] 122 | { 123 | -webkit-appearance: none; 124 | display: inline-block; 125 | width: 14px; 126 | height: 14px; 127 | margin: 0; 128 | margin-top: -2px; 129 | margin-right:5px; 130 | cursor: pointer; 131 | vertical-align: middle; 132 | background: url(../images/checkbox_login_0.png) no-repeat 0 0; 133 | border: 0; 134 | outline: none; 135 | } 136 | input[type=checkbox]:checked 137 | { 138 | margin: 0; 139 | margin-top: -2px; 140 | margin-right:5px; 141 | -webkit-appearance: none; 142 | display: inline-block; 143 | background: url(../images/checkbox_login_1.png) no-repeat 0 0; 144 | border: 0; 145 | outline: none; 146 | width: 14px; 147 | height: 14px; 148 | } 149 | .showdaan 150 | { 151 | font-size:14px; 152 | font-weight:100; 153 | margin-right:10px; 154 | } 155 | 156 | .tihao 157 | { 158 | position:relative; 159 | top:10px; 160 | width:100%; 161 | } 162 | .tihao .table1 163 | { 164 | margin: 0; 165 | white-space: normal; 166 | table-layout: fixed; 167 | display: table; 168 | font-weight: 100; 169 | } 170 | 171 | .tihao .table1 tr 172 | { 173 | display: table-row; 174 | } 175 | .tihao .table1 tr td 176 | { 177 | margin: 0; 178 | padding:0; 179 | width: 44px; 180 | height: 30px; 181 | border: 1px solid #bbb; 182 | vertical-align: top; 183 | } 184 | .tihao .table1 tr td a 185 | { 186 | margin: 0; 187 | padding:0; 188 | width:100%; 189 | float: left; 190 | text-align: center; 191 | overflow: hidden; 192 | -text-overflow: ellipsis; 193 | text-decoration:none; 194 | color: #444; 195 | } 196 | .tihao .table1 tr td span 197 | { 198 | margin: 0; 199 | width:100%; 200 | float: left; 201 | text-align: center; 202 | overflow: hidden; 203 | -text-overflow: ellipsis; 204 | font-size:12px; 205 | height:15px; 206 | line-height:15px; 207 | } 208 | .tihao .table1 tr td b 209 | { 210 | margin: 0; 211 | width:100%; 212 | float: left; 213 | text-align: left; 214 | overflow: hidden; 215 | -text-overflow: ellipsis; 216 | font-size:12px; 217 | height:15px; 218 | line-height:15px; 219 | } 220 | .currentbg 221 | { 222 | background:url(../images/currentbg.png) repeat-x 0 0; 223 | } 224 | .rightbg 225 | { 226 | background:#66FF66; 227 | } 228 | .errorbg 229 | { 230 | background:#FF0000; 231 | } -------------------------------------------------------------------------------- /Code/css/loading.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | /*主页面加载*/ 4 | #mainloading { 5 | position: absolute; 6 | top: 0; 7 | bottom: 0; 8 | left: 0; 9 | right: 0; 10 | font: 13px 'Helvetica Neue', Tahoma; 11 | color: #455469; 12 | background: transparent; 13 | z-index:2000; 14 | } 15 | #load { 16 | position: absolute; 17 | top: 50%; 18 | left: 50%; 19 | } 20 | /***************************** 圈中点变化 begin **********************************/ 21 | #circular { 22 | position: absolute; 23 | top:-50px; 24 | left:-50px; 25 | width: 100px; 26 | height: 100px; 27 | } 28 | .circular { 29 | background-color: #5FB7FF; 30 | position: absolute; 31 | width: 15px; 32 | height: 15px; 33 | border-radius: 100%; 34 | animation-name: bounce_circular; 35 | animation-duration: 2s; 36 | animation-iteration-count: infinite; 37 | animation-direction: alternate; 38 | /* Firefox: */ 39 | -moz-animation-name: bounce_circular; 40 | -moz-animation-duration: 2s; 41 | -moz-animation-iteration-count: infinite; 42 | -moz-animation-direction: alternate; 43 | /* Safari 和 Chrome */ 44 | -webkit-animation-name: bounce_circular; 45 | -webkit-animation-duration: 2s; 46 | -webkit-animation-iteration-count: infinite; 47 | -webkit-animation-direction: linear; 48 | /* Opera: */ 49 | -o-animation-name: bounce_circular; 50 | -o-animation-duration: 2s; 51 | -o-animation-iteration-count: infinite; 52 | -o-animation-direction: alternate; 53 | } 54 | #circular_1 { 55 | top: 42.5px; 56 | left: 85px; 57 | animation-delay:0s; 58 | -moz-animation-delay:0s;/* Firefox: */ 59 | -webkit-animation-delay: 0s;/* Safari 和 Chrome */ 60 | -o-animation-delay:0s;/* Opera: */ 61 | } 62 | #circular_2 { 63 | top: 67.4808732224301px; 64 | left: 76.88322226093527px; 65 | animation-delay:0.2s; 66 | -moz-animation-delay:0.2s;/* Firefox: */ 67 | -webkit-animation-delay: 0.2s;/* Safari 和 Chrome */ 68 | -o-animation-delay:0.2s;/* Opera: */ 69 | } 70 | #circular_3 { 71 | top: 82.91990194254402px; 72 | left: 55.63322226093526px; 73 | animation-delay:0.4s; 74 | -moz-animation-delay:0.4s;/* Firefox: */ 75 | -webkit-animation-delay: 0.4s;/* Safari 和 Chrome */ 76 | -o-animation-delay:0.4s;/* Opera: */ 77 | } 78 | #circular_4 { 79 | top: 82.91990194254402px; 80 | left: 29.366777739064737px; 81 | animation-delay:0.6s; 82 | -moz-animation-delay:0.6s;/* Firefox: */ 83 | -webkit-animation-delay: 0.6s;/* Safari 和 Chrome */ 84 | -o-animation-delay:0.6s;/* Opera: */ 85 | } 86 | #circular_5 { 87 | top: 67.48087322243012px; 88 | left: 8.116777739064737px; 89 | animation-delay:0.8s; 90 | -moz-animation-delay:0.8s;/* Firefox: */ 91 | -webkit-animation-delay: 0.8s;/* Safari 和 Chrome */ 92 | -o-animation-delay:0.8s;/* Opera: */ 93 | } 94 | #circular_6 { 95 | top: 42.50000000000001px; 96 | left: 0px; 97 | animation-delay:1s; 98 | -moz-animation-delay:1s;/* Firefox: */ 99 | -webkit-animation-delay: 1s;/* Safari 和 Chrome */ 100 | -o-animation-delay:1s;/* Opera: */ 101 | } 102 | #circular_7 { 103 | top: 17.519126777569895px; 104 | left: 8.11677773906473px; 105 | animation-delay:1.2s; 106 | -moz-animation-delay:1.2s;/* Firefox: */ 107 | -webkit-animation-delay: 1.2s;/* Safari 和 Chrome */ 108 | -o-animation-delay:1.2s;/* Opera: */ 109 | } 110 | #circular_8 { 111 | top: 2.0800980574559773px; 112 | left: 29.36677773906473px; 113 | animation-delay:1.4s; 114 | -moz-animation-delay:1.4s;/* Firefox: */ 115 | -webkit-animation-delay: 1.4s;/* Safari 和 Chrome */ 116 | -o-animation-delay:1.4s;/* Opera: */ 117 | } 118 | #circular_9 { 119 | top: 2.0800980574559773px; 120 | left: 55.633222260935256px; 121 | animation-delay:1.6s; 122 | -moz-animation-delay:1.6s;/* Firefox: */ 123 | -webkit-animation-delay: 1.6s;/* Safari 和 Chrome */ 124 | -o-animation-delay:1.6s;/* Opera: */ 125 | } 126 | #circular_10 { 127 | top: 17.519126777569888px; 128 | left: 76.88322226093527px; 129 | animation-delay:1.8s; 130 | -moz-animation-delay:1.8s;/* Firefox: */ 131 | -webkit-animation-delay: 1.8s;/* Safari 和 Chrome */ 132 | -o-animation-delay:1.8s;/* Opera: */ 133 | } 134 | @keyframes bounce_circular { 135 | 0% { 136 | transform:scale(1); 137 | -ms-transform:scale(1);/* IE 9 */ 138 | -webkit-transform:scale(1);/* Safari 和 Chrome */ 139 | -moz-transform:scale(1);/* Firefox */ 140 | -o-transform:scale(1);/* Opera */ 141 | } 142 | 100% { 143 | transform:scale(0.5); 144 | -ms-transform:scale(0.5);/* IE 9 */ 145 | -webkit-transform:scale(0.5);/* Safari 和 Chrome */ 146 | -moz-transform:scale(0.5);/* Firefox */ 147 | -o-transform:scale(0.5);/* Opera */; 148 | } 149 | } 150 | /* Firefox */ 151 | @-moz-keyframes bounce_circular { 152 | 0% { 153 | transform:scale(1); 154 | -ms-transform:scale(1);/* IE 9 */ 155 | -webkit-transform:scale(1);/* Safari 和 Chrome */ 156 | -moz-transform:scale(1);/* Firefox */ 157 | -o-transform:scale(1);/* Opera */ 158 | } 159 | 100% { 160 | transform:scale(0.5); 161 | -ms-transform:scale(0.5);/* IE 9 */ 162 | -webkit-transform:scale(0.5);/* Safari 和 Chrome */ 163 | -moz-transform:scale(0.5);/* Firefox */ 164 | -o-transform:scale(0.5);/* Opera */; 165 | } 166 | } 167 | /* Safari 和 Chrome */ 168 | @-webkit-keyframes bounce_circular { 169 | 0% { 170 | transform:scale(1); 171 | -ms-transform:scale(1);/* IE 9 */ 172 | -webkit-transform:scale(1);/* Safari 和 Chrome */ 173 | -moz-transform:scale(1);/* Firefox */ 174 | -o-transform:scale(1);/* Opera */ 175 | } 176 | 100% { 177 | transform:scale(0.5); 178 | -ms-transform:scale(0.5);/* IE 9 */ 179 | -webkit-transform:scale(0.5);/* Safari 和 Chrome */ 180 | -moz-transform:scale(0.5);/* Firefox */ 181 | -o-transform:scale(0.5);/* Opera */; 182 | } 183 | } 184 | /* Opera */ 185 | @-o-keyframes bounce_circular { 186 | 0% { 187 | transform:scale(1); 188 | -ms-transform:scale(1);/* IE 9 */ 189 | -webkit-transform:scale(1);/* Safari 和 Chrome */ 190 | -moz-transform:scale(1);/* Firefox */ 191 | -o-transform:scale(1);/* Opera */ 192 | } 193 | 100% { 194 | transform:scale(0.5); 195 | -ms-transform:scale(0.5);/* IE 9 */ 196 | -webkit-transform:scale(0.5);/* Safari 和 Chrome */ 197 | -moz-transform:scale(0.5);/* Firefox */ 198 | -o-transform:scale(0.5);/* Opera */; 199 | } 200 | } 201 | #circularwords { 202 | position: absolute; 203 | left: -50px; 204 | top: -50px; 205 | width: 100px; 206 | height: 100px; 207 | line-height: 100px; 208 | text-align: center; 209 | font-size: 14px; 210 | color: #10ADF7; 211 | } 212 | /***************************** 圈中点变化 end **********************************/ 213 | #samllLoading 214 | { 215 | position: absolute; 216 | top: 0; 217 | bottom:0; 218 | left: 0; 219 | right:0; 220 | width: 100%; 221 | height: 100%; 222 | background: transparent url(../../image/loading_blue_66.gif) 50% 50% no-repeat; 223 | } 224 | /***************************** 点绕圈运动 begin **********************************/ 225 | #point { 226 | height: 15px; 227 | width: 15px; 228 | position: absolute; 229 | background-color: #10ADF7; 230 | border-radius: 50%; 231 | top: 0px; 232 | left: 15px; 233 | } 234 | #ring { 235 | position: absolute; 236 | left: -50px; 237 | top: -50px; 238 | height: 100px; 239 | width: 100px; 240 | border: 2px solid #5FB7FF; 241 | border-radius: 50%; 242 | animation: ring 2s infinite; 243 | -webkit-animation: ring 2s infinite; 244 | } 245 | @keyframes ring { 246 | 0% { 247 | transform: rotate(0deg); 248 | } 249 | 100% { 250 | transform: rotate(360deg); 251 | } 252 | } 253 | @-webkit-keyframes ring { 254 | 0% { 255 | -webkit-transform: rotate(0deg); 256 | } 257 | 100% { 258 | -webkit-transform: rotate(360deg); 259 | } 260 | } 261 | #ringwords { 262 | position: absolute; 263 | left: -50px; 264 | top: -50px; 265 | width: 104px; 266 | height: 104px; 267 | line-height: 104px; 268 | text-align: center; 269 | font-size: 15px; 270 | color: #10ADF7; 271 | } 272 | /***************************** 点绕圈运动 end **********************************/ 273 | /*预览图片*/ 274 | #previewpicture { 275 | position: absolute; 276 | width: 280px; 277 | height: 280px; 278 | display: none; 279 | } 280 | #previewpicture div { 281 | position: absolute; 282 | top: 0; 283 | left: 0; 284 | width: 280px; 285 | height: 280px; 286 | background: transparent url(../../image/loading_blue_66.gif) 50% 50% no-repeat; 287 | } 288 | #previewpicture img { 289 | position: absolute; 290 | right: 0; 291 | max-height: 280px; 292 | max-width: 280px; 293 | float: right; 294 | } 295 | -------------------------------------------------------------------------------- /Code/css/main.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | body 3 | { 4 | font-family: "新宋体","Arial"; 5 | /*background:url(../images/bg.jpg) 0 -250px repeat-x;*/ 6 | background:white; 7 | left: 0; 8 | right: 0; 9 | top: 0; 10 | position: absolute; 11 | width: 100%; 12 | min-width:1280px; 13 | height: auto; 14 | margin: 0; 15 | font-size:13px; 16 | color:Black; 17 | } 18 | -------------------------------------------------------------------------------- /Code/cuoti.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using Commom; 8 | using System.Data; 9 | using DAL; 10 | 11 | public partial class cuoti : System.Web.UI.Page 12 | { 13 | public int totalTimu = 0; 14 | protected void Page_Load(object sender, EventArgs e) 15 | { 16 | string uid = new SetCookie().WhetherOnline(); 17 | if (!string.IsNullOrEmpty(uid)) 18 | { 19 | DataSet ds = new cuotiDAL().GetList(" nc_uid='" + uid + "' order by nc_qid asc"); 20 | totalTimu = ds.Tables[0].Rows.Count; 21 | DataSet tihaods = new dateConversion().getTihaoData(ds); 22 | tihaoRepeater.DataSource = tihaods; 23 | tihaoRepeater.DataBind(); 24 | } 25 | Page.DataBind(); 26 | } 27 | } -------------------------------------------------------------------------------- /Code/default.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_default" %> 2 | 3 | 4 | 5 | 6 | 信息安全竞赛练习系统 7 | 8 | 9 | 10 | 11 | 12 | 13 | 56 | 57 | 58 |
59 | 60 | 61 | <%#uname%> 62 | 63 | 64 |
65 | 66 | 个人信息 67 | 意见反馈 68 | 帮助中心 69 | 退出登录 70 |
71 |
72 |
73 |
74 | 86 |
87 |
88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /Code/default.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using Commom; 8 | using DAL; 9 | 10 | public partial class _default : System.Web.UI.Page 11 | { 12 | public string uname = null; 13 | public string domain = new settings().getdomain(); 14 | public string Year = DateTime.Now.Year.ToString(); 15 | 16 | protected void Page_Load(object sender, EventArgs e) 17 | { 18 | string uid = new SetCookie().WhetherOnline(); 19 | if (!string.IsNullOrEmpty(uid)) 20 | { 21 | uname = new yonghuDAL().GetModelById(uid).nvc_username; 22 | } 23 | if (Year == "2014") 24 | { 25 | Year = "2014"; 26 | } 27 | else 28 | { 29 | Year = "2014-" + Year; 30 | } 31 | Page.DataBind(); 32 | } 33 | } -------------------------------------------------------------------------------- /Code/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/1.jpg -------------------------------------------------------------------------------- /Code/images/accounts/checkbox_login_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/accounts/checkbox_login_0.png -------------------------------------------------------------------------------- /Code/images/accounts/checkbox_login_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/accounts/checkbox_login_1.png -------------------------------------------------------------------------------- /Code/images/accounts/glb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/accounts/glb.png -------------------------------------------------------------------------------- /Code/images/accounts/login_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/accounts/login_bg.jpg -------------------------------------------------------------------------------- /Code/images/accounts/password_safe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/accounts/password_safe.png -------------------------------------------------------------------------------- /Code/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/background.jpg -------------------------------------------------------------------------------- /Code/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/bg.jpg -------------------------------------------------------------------------------- /Code/images/checkbox_login_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/checkbox_login_0.png -------------------------------------------------------------------------------- /Code/images/checkbox_login_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/checkbox_login_1.png -------------------------------------------------------------------------------- /Code/images/currentbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/currentbg.png -------------------------------------------------------------------------------- /Code/images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/header.jpg -------------------------------------------------------------------------------- /Code/images/ico/cuowu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/cuowu.png -------------------------------------------------------------------------------- /Code/images/ico/emoticon_in_love.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/emoticon_in_love.png -------------------------------------------------------------------------------- /Code/images/ico/kaoshi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/kaoshi.png -------------------------------------------------------------------------------- /Code/images/ico/kaoshijilu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/kaoshijilu.png -------------------------------------------------------------------------------- /Code/images/ico/shoucang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/shoucang.png -------------------------------------------------------------------------------- /Code/images/ico/shoucang1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/shoucang1.png -------------------------------------------------------------------------------- /Code/images/ico/shunxu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/shunxu.png -------------------------------------------------------------------------------- /Code/images/ico/suiji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/ico/suiji.png -------------------------------------------------------------------------------- /Code/images/inform-ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/inform-ico.png -------------------------------------------------------------------------------- /Code/images/list-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/list-top.png -------------------------------------------------------------------------------- /Code/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/logo.png -------------------------------------------------------------------------------- /Code/images/判断.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/判断.PNG -------------------------------------------------------------------------------- /Code/images/单选.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/单选.PNG -------------------------------------------------------------------------------- /Code/images/多选.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/Code/images/多选.PNG -------------------------------------------------------------------------------- /Code/jiaojuan.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="jiaojuan.aspx.cs" Inherits="jiaojuan" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 |
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /Code/jiaojuan.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using DAL; 8 | using Model; 9 | using Commom; 10 | 11 | public partial class jiaojuan : System.Web.UI.Page 12 | { 13 | protected void Page_Load(object sender, EventArgs e) 14 | { 15 | string uid = new SetCookie().WhetherOnline(); 16 | if (!string.IsNullOrEmpty(uid)) 17 | { 18 | int rightTimu = 0; 19 | #region 获取考试ID,总题数 20 | string kaoshiId = null; 21 | if (!string.IsNullOrEmpty(Request.Form["kaoshiId"]))//获取数据类型 22 | { 23 | kaoshiId = Request.Form["kaoshiId"]; 24 | } 25 | int totalTimu = 0; 26 | if (!string.IsNullOrEmpty(Request.Form["totalTimu"]))//获取数据类型 27 | { 28 | totalTimu = int.Parse(Request.Form["totalTimu"]); 29 | } 30 | #endregion 31 | 32 | bool isok = false; 33 | for (int i = 1; i <= totalTimu; i++) 34 | { 35 | #region 获取数据 36 | string timuid = null; 37 | if (!string.IsNullOrEmpty(Request.Form["tihao" + i]))//获取数据类型 38 | { 39 | timuid = Request.Form["tihao" + i]; 40 | } 41 | string daanid = null; 42 | if (!string.IsNullOrEmpty(Request.Form["timudaan" + i]))//获取数据类型 43 | { 44 | daanid = Request.Form["timudaan" + i]; 45 | } 46 | bool isRight = false; 47 | if (!string.IsNullOrEmpty(Request.Form["isRight" + i]))//获取数据类型 48 | { 49 | string ir = Request.Form["isRight" + i]; 50 | if (ir == "1") 51 | { 52 | isRight = true; 53 | rightTimu++; 54 | } 55 | else 56 | { 57 | isRight = false; 58 | } 59 | } 60 | #endregion 61 | 62 | #region 提交数据 63 | questionModel qm = new questionDAL().GetModel(timuid); 64 | //单选,判断 65 | if (qm.int_qtype == 1 || qm.int_qtype == 0) 66 | { 67 | kaoshiModel ksm = new kaoshiModel(); 68 | ksm.nc_kaoshiId = kaoshiId; 69 | ksm.nc_qid = timuid; 70 | ksm.nc_daanid = daanid; 71 | ksm.bit_isRight = isRight; 72 | ksm.nc_uid = uid; 73 | isok = new kaoshiDAL().Add(ksm); 74 | } 75 | //多选 76 | if (qm.int_qtype == 2) 77 | { 78 | kaoshiModel ksm = new kaoshiModel(); 79 | ksm.nc_kaoshiId = kaoshiId; 80 | ksm.nc_qid = timuid; 81 | ksm.bit_isRight = isRight; 82 | ksm.nc_uid = uid; 83 | if (string.IsNullOrEmpty(daanid)) 84 | { 85 | isok = new kaoshiDAL().Add(ksm); 86 | } 87 | else 88 | { 89 | daanid = daanid.Substring(0, daanid.Length - 1); 90 | string[] arrayList = daanid.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); 91 | foreach (string opid in arrayList) 92 | { 93 | ksm.nc_daanid = opid; 94 | isok = new kaoshiDAL().Add(ksm); 95 | } 96 | } 97 | } 98 | #endregion 99 | } 100 | 101 | #region 更改部分数据 102 | bool isupdatechengji = new kaoshiDAL().UpDateChengji(kaoshiId, rightTimu.ToString()); 103 | bool isupdateShijian = new kaoshiDAL().UpDateShijian(kaoshiId); 104 | #endregion 105 | 106 | Response.Write(""); 107 | } 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /Code/js/ajax.js: -------------------------------------------------------------------------------- 1 | /*AJAX*/ 2 | var xmlhttp; 3 | function createxmlhttp() { 4 | if (typeof (XMLHttpRequest) != "undefined") { 5 | xmlhttp = new XMLHttpRequest(); 6 | } 7 | else { 8 | try { 9 | xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 10 | } 11 | catch (e) { 12 | try { 13 | xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 14 | } catch (e) { } 15 | } 16 | } 17 | } 18 | 19 | function startrequest(url, arg, syn, cation) { 20 | if (syn == 1) 21 | syn = false; 22 | else 23 | syn = true; 24 | 25 | createxmlhttp(); 26 | xmlhttp.open("POST", url + arg, syn); 27 | xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); 28 | xmlhttp.onreadystatechange = function () { 29 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 30 | cation(xmlhttp.responseText); 31 | } 32 | }; 33 | xmlhttp.send(); 34 | } -------------------------------------------------------------------------------- /Code/js/ceshi.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () 2 | { 3 | var qid = $('input[name=tihao1]').val(); 4 | $('a#' + qid).addClass('currentbg'); 5 | selectTimu(qid); 6 | $("span#jishimin").text('60'); 7 | $("span#jishisec").text('00'); 8 | setTimeout(changeTime, 1000); 9 | 10 | $(document).bind("contextmenu", function (e) 11 | { 12 | return false; 13 | }); 14 | }); 15 | function changeTime() 16 | { 17 | var min = $("span#jishimin").text(); 18 | var sec = $("span#jishisec").text(); 19 | min = parseInt(min); 20 | sec = parseInt(sec); 21 | if (min >= 0) 22 | { 23 | if (sec <= 0 && min > 0) 24 | { 25 | min--; 26 | sec = 59; 27 | } 28 | else if (sec <= 0 && min == 0) 29 | { 30 | jiaojuan(); 31 | } 32 | else 33 | { 34 | sec--; 35 | } 36 | $("span#jishimin").text(min); 37 | $("span#jishisec").text(sec); 38 | setTimeout(changeTime, 1000); 39 | } 40 | } 41 | /*ajax操作*/ 42 | function getDataAjax(action, tihao, timuid, timutype, daanid, response) 43 | { 44 | var xhr = new XMLHttpRequest(); 45 | xhr.onreadystatechange = function () 46 | { 47 | if (xhr.readyState == 4) 48 | { 49 | if (xhr.status == 200) 50 | { 51 | response(xhr.responseText); 52 | } 53 | } 54 | }; 55 | xhr.open("POST", "kaoshi.ashx", true); 56 | var formdata = new FormData(); 57 | formdata.append("action", action); 58 | formdata.append("tihao", tihao); 59 | formdata.append("timuid", timuid); 60 | formdata.append("timutype", timutype); 61 | formdata.append("daanid", daanid); 62 | xhr.send(formdata); 63 | } 64 | function shangyiti() 65 | { 66 | var val = $('#currentTihao').val(); 67 | var cok = $("#currentOk").val(); 68 | if (val == 1) 69 | { 70 | alert('已经是第一题啦!'); 71 | } 72 | else 73 | { 74 | var tno = parseInt(val) - 1; 75 | var timuid = $("input[name='tihao" + tno + "']").val(); 76 | selectTimu(timuid); 77 | } 78 | } 79 | function xiayiti() 80 | { 81 | var val = $('#currentTihao').val(); 82 | if (val == $("input[name^='tihao']").length) 83 | { 84 | if (window.confirm('已经是第一题啦!确定交卷?')) 85 | { 86 | jiaojuan(); 87 | } 88 | } 89 | else 90 | { 91 | var tno = parseInt(val) + 1; 92 | var timuid = $("input[name='tihao" + tno + "']").val(); 93 | selectTimu(timuid); 94 | } 95 | } 96 | function selectTimu(qid) 97 | { 98 | $("a#" + qid).addClass('currentbg'); 99 | $("body [id!=" + qid + "]").removeClass('currentbg'); 100 | var tno = $("a#" + qid).find("b").html(); 101 | $("#currentTihao").val(tno); 102 | /*获取题目内容*/ 103 | getDataAjax("getContent", "", qid, "", "", function (response) 104 | { 105 | var con = eval("[" + response + "]"); 106 | var timucontent = con[0].value; 107 | var timutype = con[1].value; 108 | var timuoptions = parseInt(con[2].value); 109 | /*选项列表*/ 110 | var timuoptionstr = ""; 111 | for (var i = 3; i < con.length; i++) 112 | { 113 | timuoptionstr += "
  • " + con[i].value + "
  • "; 114 | } 115 | /*题目内容*/ 116 | var timutypestr = ""; 117 | if (timutype == "0") 118 | { 119 | timutypestr = "(判断题)"; 120 | timuoptionstr = ""; 121 | } 122 | else if (timutype == "1") 123 | { 124 | timutypestr = "(单选题)"; 125 | } 126 | else if (timutype == "2") 127 | { 128 | timutypestr = "(多选题)"; 129 | timuoptionstr += "
  • "; 130 | } 131 | $("div.timucontent").html("" + timutypestr + tno + "、" + timucontent + ""); 132 | $("ul.timuoptions").html(timuoptionstr); 133 | /*选择*/ 134 | var selectstr = "请选择:"; 135 | if (timutype == "0") 136 | { 137 | selectstr += ""; 138 | selectstr += " "; 139 | } 140 | else if (timutype == "1" || timutype == "2") 141 | { 142 | for (var i = 0; i < timuoptions; i++) 143 | { 144 | selectstr += " "; 145 | } 146 | } 147 | $("div.selectoptions").html(selectstr); 148 | /*处理该题是否已经做了,做了则不能选*/ 149 | var rightstr = $("input[name='isRight" + tno + "']").val(); 150 | if (rightstr == "0" || rightstr == "1") 151 | { 152 | $("input[name='timuoptions']").removeAttr("onclick"); 153 | $("input[name='timuoptions']").attr("disabled", true); 154 | 155 | var myopid = $("input[name='timudaan" + tno + "']").val(); 156 | 157 | var myopidArr = new Array(); 158 | myopidArr = myopid.split(",") 159 | var myopidVal = ""; 160 | for (var i = 0; i < myopidArr.length; i++) 161 | { 162 | if (myopidArr[i] != null && myopidArr[i] != "" && typeof (myopidArr[i]) != "undefined") 163 | { 164 | myopidVal += $("#" + myopidArr[i]).val(); 165 | } 166 | } 167 | $("span#youselectdaan").text(myopidVal); 168 | $("a#" + qid).find("span").text(myopidVal); 169 | } 170 | else 171 | { 172 | $("span#youselectdaan").text(""); 173 | } 174 | }); 175 | } 176 | function getCaps(i) 177 | { 178 | var x = ""; 179 | switch (i) 180 | { 181 | case 0: 182 | x = "A"; 183 | break; 184 | case 1: 185 | x = "B"; 186 | break; 187 | case 2: 188 | x = "C"; 189 | break; 190 | case 3: 191 | x = "D"; 192 | break; 193 | case 4: 194 | x = "E"; 195 | break; 196 | case 5: 197 | x = "F"; 198 | break; 199 | } 200 | return x; 201 | } 202 | function dati(tihao, timutype, timuid, options, opid) 203 | { 204 | if (timutype == "0" || timutype == "1") 205 | { 206 | $("span#youselectdaan").text(options); 207 | $("input[name='timudaan" + tihao + "']").val(opid); 208 | tijiao(tihao, timutype, timuid); 209 | } 210 | /*多选题*/ 211 | if (timutype == "2") 212 | { 213 | var currentop = $("span#youselectdaan").text(); 214 | var currentDaan = $("input[name='timudaan" + tihao + "']").val(); 215 | if (currentop.search(options) == -1) 216 | { 217 | currentop += options; 218 | currentDaan += opid + ","; 219 | } 220 | else 221 | { 222 | currentop = currentop.replace(options, ""); 223 | currentDaan = currentDaan.replace(opid + ",", ""); 224 | } 225 | /*对答案排序*/ 226 | var resop = ""; 227 | var arr = new Array('A', 'B', 'C', 'D', 'E', 'F'); 228 | for (var i = 0; i < arr.length; i++) 229 | { 230 | if (currentop.search(arr[i]) > -1) 231 | { 232 | resop += arr[i]; 233 | } 234 | } 235 | $("span#youselectdaan").text(resop); 236 | $("input[name='timudaan" + tihao + "']").val(currentDaan); 237 | } 238 | } 239 | /*判断对错*/ 240 | function tijiao(tihao, timutype, timuid) 241 | { 242 | var daanid = $("input[name='timudaan" + tihao + "']").val(); 243 | getDataAjax("isRight", tihao, timuid, timutype, daanid, function (response) 244 | { 245 | $("a#" + timuid).find("span").text($("span#youselectdaan").text()); 246 | $("input[name='isRight" + tihao + "']").val(response); 247 | if (response == "1") 248 | { 249 | $("a#" + timuid).addClass("rightbg"); 250 | } 251 | if (response == "0") 252 | { 253 | $("a#" + timuid).addClass("errorbg"); 254 | } 255 | $("#currentOk").val($("#currentOk").val() + tihao + ","); 256 | xiayiti(); 257 | }); 258 | } 259 | function jiaojuan() 260 | { 261 | $("#mainloading").css("display",""); 262 | document.getElementById("kaoshi").submit(); 263 | } 264 | -------------------------------------------------------------------------------- /Code/js/common.js: -------------------------------------------------------------------------------- 1 | function $(id) { return document.getElementById(id) } 2 | function _c(_lab) { 3 | return document.createElement(_lab); 4 | } 5 | function loadJs(_url) { 6 | var callback = arguments[1] || function () { 7 | }; 8 | // load_js_url = _url; 9 | var _script = _c("SCRIPT"); 10 | _script.setAttribute("type", "text/javascript"); 11 | _script.setAttribute("src", _url); 12 | document.getElementsByTagName("head")[0].appendChild(_script); 13 | if (document.all) { 14 | _script.onreadystatechange = function () { 15 | if (/onload|loaded|complete/.test(_script.readyState)) { 16 | callback && callback(); 17 | } 18 | }; 19 | } else { 20 | _script.onload = function () { 21 | callback(); 22 | }; 23 | } 24 | } 25 | String.prototype.trim = function () { 26 | return this.replace(/(^\s*)|(\s*$)/g, ""); 27 | }; 28 | //换算中文字长 29 | String.prototype.cnSize = function () { 30 | var arr = this.match(/[^\x00-\xff]/ig); 31 | return this.length + (arr == null ? 0 : arr.length); 32 | }; -------------------------------------------------------------------------------- /Code/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /Code/js/lianxi.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () 2 | { 3 | var qid = $('input[name=tihao1]').val(); 4 | $('a#' + qid).addClass('currentbg'); 5 | selectTimu(qid); 6 | var ck = $("input[type='checkbox']").is(':checked'); 7 | if (ck == true) 8 | { 9 | showdaan(); 10 | } 11 | $("input[type='checkbox']").click(function () 12 | { 13 | var ck = $("input[type='checkbox']").is(':checked'); 14 | if (ck == true) 15 | { 16 | showdaan(); 17 | } 18 | else 19 | { 20 | $("div.rightdaan").text(""); 21 | } 22 | }); 23 | 24 | $(document).bind("contextmenu", function (e) 25 | { 26 | return false; 27 | }); 28 | }); 29 | /*ajax操作*/ 30 | function getDataAjax(action, tihao, timuid, timutype, daanid, response) 31 | { 32 | var xhr = new XMLHttpRequest(); 33 | xhr.onreadystatechange = function () 34 | { 35 | if (xhr.readyState == 4) 36 | { 37 | if (xhr.status == 200) 38 | { 39 | response(xhr.responseText); 40 | } 41 | } 42 | }; 43 | xhr.open("POST", "kaoshi.ashx", true); 44 | var formdata = new FormData(); 45 | formdata.append("action", action); 46 | formdata.append("tihao", tihao); 47 | formdata.append("timuid", timuid); 48 | formdata.append("timutype", timutype); 49 | formdata.append("daanid", daanid); 50 | xhr.send(formdata); 51 | } 52 | function shangyiti() 53 | { 54 | var val = $('#currentTihao').val(); 55 | var cok = $("#currentOk").val(); 56 | if (val == 1) 57 | { 58 | alert('已经是第一题啦!'); 59 | } 60 | else 61 | { 62 | var tno = parseInt(val) - 1; 63 | var timuid = $("input[name='tihao" + tno + "']").val(); 64 | selectTimu(timuid); 65 | } 66 | } 67 | function xiayiti() 68 | { 69 | var val = $('#currentTihao').val(); 70 | if (val == $("input[name^='tihao']").length) 71 | { 72 | alert("已经是第一题啦!"); 73 | } 74 | else 75 | { 76 | var tno = parseInt(val) + 1; 77 | var timuid = $("input[name='tihao" + tno + "']").val(); 78 | selectTimu(timuid); 79 | } 80 | } 81 | function showdaan() 82 | { 83 | var tno = $('#currentTihao').val(); 84 | var timuid = $("input[name='tihao" + tno + "']").val(); 85 | showRight(timuid); 86 | } 87 | function selectTimu(qid) 88 | { 89 | $("a#" + qid).addClass('currentbg'); 90 | $("body [id!=" + qid + "]").removeClass('currentbg'); 91 | var tno = $("a#" + qid).find("b").html(); 92 | $("#currentTihao").val(tno); 93 | /*获取题目内容*/ 94 | getDataAjax("getContent", "", qid, "", "", function (response) 95 | { 96 | var con = eval("[" + response + "]"); 97 | var timucontent = con[0].value; 98 | var timutype = con[1].value; 99 | var timuoptions = parseInt(con[2].value); 100 | /*选项列表*/ 101 | var timuoptionstr = ""; 102 | for (var i = 3; i < con.length; i++) 103 | { 104 | timuoptionstr += "
  • " + con[i].value + "
  • "; 105 | } 106 | /*题目内容*/ 107 | var timutypestr = ""; 108 | if (timutype == "0") 109 | { 110 | timutypestr = "(判断题)"; 111 | timuoptionstr = ""; 112 | } 113 | else if (timutype == "1") 114 | { 115 | timutypestr = "(单选题)"; 116 | } 117 | else if (timutype == "2") 118 | { 119 | timutypestr = "(多选题)"; 120 | timuoptionstr += "
  • "; 121 | } 122 | $("div.timucontent").html("" + timutypestr + tno + "、" + timucontent + ""); 123 | $("ul.timuoptions").html(timuoptionstr); 124 | /*选择*/ 125 | var selectstr = "请选择:"; 126 | if (timutype == "0") 127 | { 128 | selectstr += ""; 129 | selectstr += " "; 130 | } 131 | else if (timutype == "1" || timutype == "2") 132 | { 133 | for (var i = 0; i < timuoptions; i++) 134 | { 135 | selectstr += " "; 136 | } 137 | } 138 | $("div.selectoptions").html(selectstr); 139 | /*处理该题是否已经做了,做了则不能选*/ 140 | var rightstr = $("input[name='isRight" + tno + "']").val(); 141 | if (rightstr == "0" || rightstr == "1") 142 | { 143 | $("input[name='timuoptions']").removeAttr("onclick"); 144 | $("input[name='timuoptions']").attr("disabled", true); 145 | 146 | var myopid = $("input[name='timudaan" + tno + "']").val(); 147 | var myopidArr = new Array(); 148 | myopidArr = myopid.split(",") 149 | var myopidVal = ""; 150 | for (var i = 0; i < myopidArr.length; i++) 151 | { 152 | if (myopidArr[i] != null && myopidArr[i] != "" && typeof (myopidArr[i]) != "undefined") 153 | { 154 | myopidVal += $("#" + myopidArr[i]).val(); 155 | } 156 | } 157 | $("span#youselectdaan").text(myopidVal); 158 | $("a#" + qid).find("span").text(myopidVal); 159 | } 160 | else 161 | { 162 | $("span#youselectdaan").text(""); 163 | $("div.rightdaan").text(""); 164 | } 165 | var ck = $("input[type='checkbox']").is(':checked'); 166 | if (ck == true) 167 | { 168 | showRight(qid); 169 | } 170 | }); 171 | } 172 | function getCaps(i) 173 | { 174 | var x = ""; 175 | switch (i) 176 | { 177 | case 0: 178 | x = "A"; 179 | break; 180 | case 1: 181 | x = "B"; 182 | break; 183 | case 2: 184 | x = "C"; 185 | break; 186 | case 3: 187 | x = "D"; 188 | break; 189 | case 4: 190 | x = "E"; 191 | break; 192 | case 5: 193 | x = "F"; 194 | break; 195 | } 196 | return x; 197 | } 198 | function dati(tihao, timutype, timuid, options, opid) 199 | { 200 | if (timutype == "0" || timutype == "1") 201 | { 202 | $("span#youselectdaan").text(options); 203 | $("input[name='timudaan" + tihao + "']").val(opid); 204 | tijiao(tihao, timutype, timuid); 205 | } 206 | /*多选题*/ 207 | if (timutype == "2") 208 | { 209 | var currentop = $("span#youselectdaan").text(); 210 | var currentDaan = $("input[name='timudaan" + tihao + "']").val(); 211 | if (currentop.search(options) == -1) 212 | { 213 | currentop += options; 214 | currentDaan += opid + ","; 215 | } 216 | else 217 | { 218 | currentop = currentop.replace(options, ""); 219 | currentDaan = currentDaan.replace(opid + ",", ""); 220 | } 221 | /*对答案排序*/ 222 | var resop = ""; 223 | var arr = new Array('A', 'B', 'C', 'D', 'E', 'F'); 224 | for (var i = 0; i < arr.length; i++) 225 | { 226 | if (currentop.search(arr[i]) > -1) 227 | { 228 | resop += arr[i]; 229 | } 230 | } 231 | $("span#youselectdaan").text(resop); 232 | $("input[name='timudaan" + tihao + "']").val(currentDaan); 233 | } 234 | } 235 | /*判断对错*/ 236 | function tijiao(tihao, timutype, timuid) 237 | { 238 | var daanid = $("input[name='timudaan" + tihao + "']").val(); 239 | getDataAjax("isRight", tihao, timuid, timutype, daanid, function (response) 240 | { 241 | $("a#" + timuid).find("span").text($("span#youselectdaan").text()); 242 | $("input[name='isRight" + tihao + "']").val(response); 243 | if (response == "1") 244 | { 245 | $("a#" + timuid).addClass("rightbg"); 246 | xiayiti(); 247 | } 248 | if (response == "0") 249 | { 250 | $("a#" + timuid).addClass("errorbg"); 251 | showRight(timuid); 252 | } 253 | $("#currentOk").val($("#currentOk").val() + tihao + ","); 254 | 255 | }); 256 | } 257 | function showRight(qid) 258 | { 259 | /*显示正确答案*/ 260 | getDataAjax("getRight", "", qid, "", "", function (response) 261 | { 262 | var rightcon = eval("[" + response + "]"); 263 | var timutype = rightcon[0].value; 264 | var rightOptions = ""; 265 | for (var i = 1; i < rightcon.length; i++) 266 | { 267 | rightOptions += $("#" + rightcon[i].opid).val(); 268 | } 269 | /*对答案排序*/ 270 | var resop = ""; 271 | if (timutype == "2") 272 | { 273 | 274 | var arr = new Array('A', 'B', 'C', 'D', 'E', 'F'); 275 | for (var i = 0; i < arr.length; i++) 276 | { 277 | if (rightOptions.search(arr[i]) > -1) 278 | { 279 | resop += arr[i]; 280 | } 281 | } 282 | } 283 | else 284 | { 285 | resop = rightOptions; 286 | } 287 | $("div.rightdaan").text("正确答案:" + resop); 288 | }); 289 | } 290 | -------------------------------------------------------------------------------- /Code/js/register.js: -------------------------------------------------------------------------------- 1 | //检查用户名 2 | function checkUser() 3 | { 4 | username = document.getElementById("CreateUsername").value; 5 | if (username == '') 6 | { 7 | document.getElementById("msg_username").style.display = ''; 8 | document.getElementById("msg_username").className = 'account-register-span'; 9 | document.getElementById("msg_username").innerHTML = '6~20个字符,可使用汉字、字母、数字,区分大小写。'; 10 | return false; 11 | } 12 | if (/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,4}$/.test(username)) 13 | { 14 | document.getElementById("CreateEmail").value = username; 15 | } 16 | if (username.length < 6) 17 | { 18 | document.getElementById("msg_username").style.display = ''; 19 | document.getElementById("msg_username").className = 'account-register-span-error'; 20 | document.getElementById("msg_username").innerHTML = ' 最少6个字符。'; 21 | return false; 22 | } 23 | if (username.replace(/[^\x00-\xff]/g, "**").length > 20) 24 | { 25 | document.getElementById("msg_username").style.display = ''; 26 | document.getElementById("msg_username").className = 'account-register-span-error'; 27 | document.getElementById("msg_username").innerHTML = ' 请不要超过20个字符。'; 28 | return false; 29 | } 30 | if (/[^\u4E00-\u9FA5\w_@\.\-]/.test(username)) 31 | { 32 | document.getElementById("msg_username").style.display = ''; 33 | document.getElementById("msg_username").className = 'account-register-span-error'; 34 | document.getElementById("msg_username").innerHTML = ' 请输入汉字、字母、数字。'; 35 | return false; 36 | } 37 | startrequest('../account/register.ashx?', 'type=username&value=' + username, 1, function (response) 38 | { 39 | if (response == 1) 40 | { 41 | err = 1; 42 | } 43 | else 44 | { 45 | err = 0; 46 | } 47 | }); 48 | if (err == 1) 49 | { 50 | document.getElementById("msg_username").style.display = ''; 51 | document.getElementById("msg_username").className = 'account-register-span-error'; 52 | document.getElementById("msg_username").innerHTML = ' 此帐号已被注册,请重新输入。'; 53 | return false; 54 | } 55 | if (username != username.toLowerCase()) 56 | { 57 | document.getElementById("msg_username").style.display = ''; 58 | document.getElementById("msg_username").className = 'account-register-span-right'; 59 | document.getElementById("msg_username").innerHTML = ' 恭喜,此帐号可注册。登录时区分大小写。'; 60 | } 61 | else 62 | { 63 | document.getElementById("msg_username").className = 'account-register-span-right'; 64 | document.getElementById("msg_username").innerHTML = ' 恭喜,此帐号可注册。'; 65 | } 66 | return true; 67 | } 68 | //检查用户名的长度 69 | function checkUserLength() 70 | { 71 | document.getElementById("msg_username").style.display = ''; 72 | var username = document.getElementById("CreateUsername").value; 73 | if (username.length > 20) 74 | { 75 | document.getElementById("msg_username").className = 'account-register-span-error'; 76 | document.getElementById("msg_username").innerHTML = ' 请不要超过20个字符。'; 77 | return false; 78 | } 79 | document.getElementById("msg_username").className = 'account-register-span'; 80 | document.getElementById("msg_username").innerHTML = '6~20个字符,可使用汉字、字母、数字,区分大小写。'; 81 | return true; 82 | } 83 | //检查密码 84 | function checkPass() 85 | { 86 | var pass = document.getElementById("CreatePassword").value; 87 | if (pass == "") 88 | { 89 | document.getElementById("msg_password").style.display = ''; 90 | document.getElementById("msg_password").className = 'account-register-span'; 91 | document.getElementById("msg_password").innerHTML = '6~16个字符,可使用字母、数字、符号,区分大小写。'; 92 | return false; 93 | } 94 | if (pass.length < 6) 95 | { 96 | document.getElementById("msg_password").style.display = ''; 97 | document.getElementById('passwdSocre').style.display = 'none'; 98 | document.getElementById("msg_password").className = 'account-register-span-error'; 99 | document.getElementById("msg_password").innerHTML = ' 最少6个字符。'; 100 | 101 | return false; 102 | } 103 | if (pass.length > 16) 104 | { 105 | document.getElementById("msg_password").style.display = ''; 106 | document.getElementById('passwdSocre').style.display = 'none'; 107 | document.getElementById("msg_password").className = 'account-register-span-error'; 108 | document.getElementById("msg_password").innerHTML = ' 最多16个字符。'; 109 | return false; 110 | } 111 | if (pass == document.getElementById('CreateUsername').value) 112 | { 113 | document.getElementById("msg_password").style.display = ''; 114 | document.getElementById('passwdSocre').style.display = 'none'; 115 | document.getElementById("msg_password").className = 'account-register-span-error'; 116 | document.getElementById("msg_password").innerHTML = ' 密码不能与帐号一致,请重新输入。'; 117 | return false; 118 | } 119 | if (pass == '123456' || pass == '654321' || pass == '111222' || checkPassSame(pass) == false) 120 | { 121 | document.getElementById("msg_password").style.display = ''; 122 | document.getElementById('passwdSocre').style.display = 'none'; 123 | document.getElementById("msg_password").className = 'account-register-span-error'; 124 | document.getElementById("msg_password").innerHTML = ' 您的密码过于简单,请重新输入。'; 125 | return false; 126 | } 127 | document.getElementById("msg_password").className = 'account-register-span-right'; 128 | document.getElementById("msg_password").innerHTML = ' 密码强度:'; 129 | document.getElementById('passwdSocre').style.display = ''; 130 | return true; 131 | } 132 | //检查二次输入的密码 133 | function checkRepass() 134 | { 135 | var pass = document.getElementById("CreateRePassword").value; 136 | if (pass == "") 137 | { 138 | document.getElementById("msg_repassword").style.display = ''; 139 | document.getElementById("msg_repassword").className = 'account-register-span'; 140 | document.getElementById("msg_repassword").innerHTML = '请再输入一次。'; 141 | return false; 142 | } 143 | if (pass.length < 6) 144 | { 145 | document.getElementById("msg_repassword").style.display = ''; 146 | document.getElementById("msg_repassword").className = 'account-register-span-error'; 147 | document.getElementById("msg_repassword").innerHTML = ' 最少6个字符。'; 148 | return false; 149 | } 150 | if (pass.length > 16) 151 | { 152 | document.getElementById("msg_repassword").style.display = ''; 153 | document.getElementById("msg_repassword").className = 'account-register-span-error'; 154 | document.getElementById("msg_repassword").innerHTML = ' 最多16个字符。'; 155 | return false; 156 | } 157 | if (pass != document.getElementById("CreatePassword").value) 158 | { 159 | document.getElementById("msg_repassword").style.display = ''; 160 | document.getElementById("msg_repassword").className = 'account-register-span-error'; 161 | document.getElementById("msg_repassword").innerHTML = ' 两次输入的密码不一致。'; 162 | return false; 163 | } 164 | if (pass == document.getElementById('CreateUsername').value) 165 | { 166 | document.getElementById("msg_repassword").style.display = ''; 167 | document.getElementById("msg_repassword").className = 'account-register-span-error'; 168 | document.getElementById("msg_repassword").innerHTML = ' 密码不能与帐号一致,请重新输入。'; 169 | return false; 170 | } 171 | document.getElementById("msg_repassword").className = 'account-register-span-right'; 172 | document.getElementById("msg_repassword").innerHTML = ' 两次输入的密码一致。'; 173 | return true; 174 | } 175 | //验证码 176 | function checkValidate_sj() 177 | { 178 | val = document.getElementById("validate").value; 179 | if (val == '') 180 | { 181 | document.getElementById("msg_validate").className = 'account-register-span'; 182 | document.getElementById("msg_validate").innerHTML = '请填写图片中的字符,不区分大小写'; 183 | return false; 184 | } 185 | startrequest('../account/register.ashx?', 'type=validate&value=' + val, 1, function (response) 186 | { 187 | if (response == 1) 188 | { 189 | err = 1; 190 | } 191 | else 192 | { 193 | err = 0; 194 | } 195 | }); 196 | if (err == 1) 197 | { 198 | document.getElementById("msg_validate").className = 'account-register-span-right'; 199 | document.getElementById("msg_validate").innerHTML = ' 您输入的验证码正确'; 200 | document.getElementById("code").style.display = "none"; 201 | return true; 202 | } 203 | else 204 | { 205 | document.getElementById("msg_validate").style.display = ''; 206 | document.getElementById("msg_validate").className = 'account-register-span-error'; 207 | document.getElementById("validate").value = ''; 208 | document.getElementById("validate").focus() 209 | document.getElementById("msg_validate").innerHTML = ' 您输入的验证码错误,请重新输入'; 210 | document.getElementById('imgOK').src = "../account/VerifyCode.ashx?active=" + new Date().getMilliseconds(); 211 | return false; 212 | } 213 | } 214 | function checkAll() 215 | { 216 | if (!checkUser()) 217 | { 218 | document.getElementById("CreateUsername").focus(); 219 | return false; 220 | } 221 | if (!checkPass()) 222 | { 223 | document.getElementById("CreatePassword").focus(); 224 | return false; 225 | } 226 | if (!checkRepass()) 227 | { 228 | document.getElementById("CreateRePassword").focus(); 229 | return false; 230 | } 231 | if (!checkValidate_sj()) 232 | { 233 | document.getElementById("validate").focus(); 234 | return false; 235 | } 236 | if (!document.getElementById("registerAgree").checked) 237 | { 238 | alert("请阅读并接受\"服务条款\"和\"用户须知\"、\"隐私权相关政策\""); 239 | return false; 240 | } 241 | $("input[name='action']").val("Register"); 242 | return true; 243 | } 244 | 245 | //检查密码是否一致 246 | function checkPassSame(pass) 247 | { 248 | var first = pass.substring(0, 1); 249 | var exp = new RegExp('^' + first + '+document.getElementById'); 250 | if (exp.test(pass)) 251 | { 252 | return false; 253 | } 254 | if (first == 'a' || first == 'A') 255 | { 256 | f = pass.charCodeAt(0); 257 | for (i = 1; i < pass.length; i++) 258 | { 259 | tmp = pass.charCodeAt(i); 260 | if (tmp - f != i) 261 | { 262 | return true; 263 | } 264 | } 265 | return false; 266 | } 267 | return true; 268 | } 269 | function safe() 270 | { 271 | var pass = document.getElementById("CreatePassword").value; 272 | if (pass.length < 6) 273 | { 274 | var score = 0; 275 | } 276 | else if (pass == document.getElementById('CreateUsername').value) 277 | { 278 | var score = 0; 279 | } 280 | else if (pass == '123456' || pass == '654321' || pass == '111222' || checkPassSame(pass) == false) 281 | { 282 | var score = 0; 283 | } 284 | else 285 | { 286 | var score = passwordGrade(pass); 287 | } 288 | if (score <= 10) 289 | { 290 | document.getElementById('w1').style.display = ''; 291 | document.getElementById('w2').style.display = 'none'; 292 | document.getElementById('w3').style.display = 'none'; 293 | document.getElementById('w4').style.display = 'none'; 294 | document.getElementById("msg_password").className = 'account-register-span'; 295 | document.getElementById("msg_password").innerHTML = '密码强度:'; 296 | } 297 | else if (score >= 11 && score <= 20) 298 | { 299 | document.getElementById('w1').style.display = 'none'; 300 | document.getElementById('w2').style.display = ''; 301 | document.getElementById('w3').style.display = 'none'; 302 | document.getElementById('w4').style.display = 'none'; 303 | document.getElementById("msg_password").className = 'account-register-span'; 304 | document.getElementById("msg_password").innerHTML = '密码强度:'; 305 | } 306 | else if (score >= 21 && score <= 30) 307 | { 308 | document.getElementById('w1').style.display = 'none'; 309 | document.getElementById('w2').style.display = 'none'; 310 | document.getElementById('w3').style.display = ''; 311 | document.getElementById('w4').style.display = 'none'; 312 | document.getElementById("msg_password").className = 'account-register-span'; 313 | document.getElementById("msg_password").innerHTML = '密码强度:'; 314 | } 315 | else 316 | { 317 | document.getElementById('w1').style.display = 'none'; 318 | document.getElementById('w2').style.display = 'none'; 319 | document.getElementById('w3').style.display = 'none'; 320 | document.getElementById('w4').style.display = ''; 321 | document.getElementById("msg_password").className = 'account-register-span'; 322 | document.getElementById("msg_password").innerHTML = '密码强度:'; 323 | } 324 | } 325 | //计算密码安全系数 326 | function passwordGrade(pwd) 327 | { 328 | var score = 0; 329 | var regexArr = ['[0-9]', '[a-z]', '[A-Z]', '[\\W_]']; 330 | var repeatCount = 0; 331 | var prevChar = ''; 332 | //check length 333 | var len = pwd.length; 334 | score += len > 18 ? 18 : len; 335 | //check type 336 | for (var i = 0, num = regexArr.length; i < num; i++) 337 | { 338 | if (eval('/' + regexArr[i] + '/').test(pwd)) 339 | score += 4; 340 | } 341 | //bonus point 342 | for (var i = 0, num = regexArr.length; i < num; i++) 343 | { 344 | if (pwd.match(eval('/' + regexArr[i] + '/g')) && pwd.match(eval('/' + regexArr[i] + '/g')).length >= 2) 345 | score += 2; 346 | if (pwd.match(eval('/' + regexArr[i] + '/g')) && pwd.match(eval('/' + regexArr[i] + '/g')).length >= 5) 347 | score += 2; 348 | } 349 | //deduction 350 | for (var i = 0, num = pwd.length; i < num; i++) 351 | { 352 | if (pwd.charAt(i) == prevChar) 353 | repeatCount++; 354 | else 355 | prevChar = pwd.charAt(i); 356 | } 357 | score -= repeatCount * 1; 358 | return score; 359 | } -------------------------------------------------------------------------------- /Code/kaoshi.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="kaoshi" %> 2 | 3 | using System; 4 | using System.Web; 5 | using System.Data; 6 | using Model; 7 | using DAL; 8 | using Commom; 9 | 10 | public class kaoshi : IHttpHandler 11 | { 12 | public void ProcessRequest(HttpContext context) 13 | { 14 | context.Response.ContentType = "text/plain"; 15 | string uid = new SetCookie().WhetherOnline(); 16 | if (!string.IsNullOrEmpty(uid)) 17 | { 18 | string html = null; 19 | string action = null; 20 | if (!string.IsNullOrEmpty(context.Request.Form["action"]))//获取数据类型 21 | { 22 | action = context.Request.Form["action"]; 23 | } 24 | string timuid = null; 25 | if (!string.IsNullOrEmpty(context.Request.Form["timuid"]))//获取数据类型 26 | { 27 | timuid = context.Request.Form["timuid"]; 28 | } 29 | #region 获取题目内容 30 | if (action == "getContent" && !string.IsNullOrEmpty(timuid)) 31 | { 32 | string json = string.Empty; 33 | questionModel qm = new questionDAL().GetModel(timuid); 34 | DataSet ds = new optionsDAL().GetList(" nc_qid='" + timuid + "' order by newid()"); 35 | json = "{text:'timucontent',value:'" + qm.nvc_qcontent + "',opid:''}"; 36 | json += ",{text:'timutype',value:'" + qm.int_qtype + "',opid:''}"; 37 | json += ",{text:'timuoptions',value:'" + ds.Tables[0].Rows.Count + "',opid:''}"; 38 | if (qm.int_qtype == 1 || qm.int_qtype == 2) 39 | { 40 | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) 41 | { 42 | json += ","; 43 | json += "{text:'timuoptions" + i + "',value:'" + getABCD(i) + ":" + ds.Tables[0].Rows[i]["nvc_opcontent"].ToString() + "',opid:'" + ds.Tables[0].Rows[i]["nc_opid"].ToString() + "'}"; 44 | } 45 | } 46 | html = json; 47 | } 48 | #endregion 49 | 50 | #region 判断答案是否正确 51 | if (action == "isRight" && !string.IsNullOrEmpty(timuid)) 52 | { 53 | string tihao = null; 54 | if (!string.IsNullOrEmpty(context.Request.Form["tihao"])) 55 | { 56 | tihao = context.Request.Form["tihao"]; 57 | } 58 | string timutype = null; 59 | if (!string.IsNullOrEmpty(context.Request.Form["timutype"])) 60 | { 61 | timutype = context.Request.Form["timutype"]; 62 | } 63 | string daanid = null; 64 | if (!string.IsNullOrEmpty(context.Request.Form["daanid"])) 65 | { 66 | daanid = context.Request.Form["daanid"]; 67 | } 68 | if (!string.IsNullOrEmpty(tihao) && !string.IsNullOrEmpty(timutype) && !string.IsNullOrEmpty(daanid)) 69 | { 70 | if (timutype == "0" || timutype == "1") 71 | { 72 | html = whetherRight(timuid, daanid); 73 | } 74 | if (timutype == "2") 75 | { 76 | daanid = daanid.Substring(0, daanid.Length - 1); 77 | string[] arrayList = daanid.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); 78 | string rightStr = "1"; 79 | foreach (string opid in arrayList) 80 | { 81 | if (!string.IsNullOrEmpty(opid)) 82 | { 83 | if (whetherRight(timuid, daanid) == "0") 84 | { 85 | rightStr = "0"; 86 | } 87 | } 88 | } 89 | if (rightStr == "1") 90 | { 91 | html = "1"; 92 | } 93 | if (rightStr == "0") 94 | { 95 | html = "0"; 96 | } 97 | } 98 | } 99 | if (html == "0") 100 | { 101 | cuotiModel ctm = new cuotiModel(); 102 | ctm.nc_qid = timuid; 103 | ctm.nc_uid = uid; 104 | bool isok = new cuotiDAL().Add(ctm); 105 | } 106 | } 107 | #endregion 108 | 109 | #region 获取正确答案 110 | if (action == "getRight" && !string.IsNullOrEmpty(timuid)) 111 | { 112 | string json = string.Empty; 113 | questionModel qm = new questionDAL().GetModel(timuid); 114 | json += "{text:'timutype',value:'" + qm.int_qtype + "',opid:''}"; 115 | DataSet ds = new optionsDAL().GetList(" nc_qid='" + timuid + "' and bit_isright=1"); 116 | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) 117 | { 118 | json += ","; 119 | json += "{text:'timuoptions" + i + "',opid:'" + ds.Tables[0].Rows[i]["nc_opid"].ToString() + "'}"; 120 | } 121 | html = json; 122 | } 123 | #endregion 124 | context.Response.Write(html); 125 | } 126 | } 127 | 128 | 129 | /// 130 | /// 判断答案是否正确 131 | /// 132 | /// 题目id 133 | /// 答案id 134 | /// 135 | private string whetherRight(string timuid, string daanid) 136 | { 137 | string isright = "0"; 138 | DataSet ds = new optionsDAL().GetList(" nc_qid='" + timuid + "' and nc_opid='" + daanid + "'"); 139 | if (ds.Tables[0].Rows.Count > 0) 140 | { 141 | bool isok = false; 142 | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) 143 | { 144 | isok = (bool)ds.Tables[0].Rows[i]["bit_isright"]; 145 | } 146 | if (isok) 147 | { 148 | isright = "1"; 149 | } 150 | } 151 | return isright; 152 | } 153 | 154 | /// 155 | /// 获取选项的ABCDE 156 | /// 157 | /// 序号 158 | /// 159 | private string getABCD(int i) 160 | { 161 | string str = null; 162 | switch (i) 163 | { 164 | case 0: str = "A"; break; 165 | case 1: str = "B"; break; 166 | case 2: str = "C"; break; 167 | case 3: str = "D"; break; 168 | case 4: str = "E"; break; 169 | case 5: str = "F"; break; 170 | default: break; 171 | } 172 | return str; 173 | } 174 | 175 | public bool IsReusable 176 | { 177 | get 178 | { 179 | return false; 180 | } 181 | } 182 | 183 | } -------------------------------------------------------------------------------- /Code/kaoshi.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using System.Data; 8 | using DAL; 9 | using Commom; 10 | 11 | public partial class kaoshi : System.Web.UI.Page 12 | { 13 | public string kaoshiid = DateTime.Now.ToString("yyyyMMddHHmmssffff"); 14 | public int totalTimu = 0; 15 | protected void Page_Load(object sender, EventArgs e) 16 | { 17 | string uid = new SetCookie().WhetherOnline(); 18 | if (!string.IsNullOrEmpty(uid)) 19 | { 20 | DataSet ds = new questionDAL().GetList(" where nc_qid in(select top 200 nc_qid from question order by newid()) order by int_qtype asc"); 21 | totalTimu = ds.Tables[0].Rows.Count; 22 | DataSet tihaods = new dateConversion().getTihaoData(ds); 23 | tihaoRepeater.DataSource = tihaods; 24 | tihaoRepeater.DataBind(); 25 | } 26 | Page.DataBind(); 27 | } 28 | } -------------------------------------------------------------------------------- /Code/lianxi.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | using DAL; 8 | using System.Data; 9 | using Commom; 10 | 11 | public partial class lianxi : System.Web.UI.Page 12 | { 13 | public int totalTimu = 0; 14 | public string title = null; 15 | protected void Page_Load(object sender, EventArgs e) 16 | { 17 | string uid = new SetCookie().WhetherOnline(); 18 | if (!string.IsNullOrEmpty(uid)) 19 | { 20 | 21 | string type = null; 22 | if (!string.IsNullOrEmpty(Request.QueryString["type"]))//获取数据类型 23 | { 24 | type = Request.QueryString["type"]; 25 | } 26 | if (type == "b8ca28006a659d5fed930fcf333976be") 27 | { 28 | DataSet ds = new questionDAL().GetList(" order by nc_qid asc"); 29 | totalTimu = ds.Tables[0].Rows.Count; 30 | DataSet tihaods = new dateConversion().getTihaoData(ds); 31 | tihaoRepeater.DataSource = tihaods; 32 | tihaoRepeater.DataBind(); 33 | title = "顺序练习"; 34 | } 35 | if (type == "a1d8bfacd7aa75f6f6500f361e352648") 36 | { 37 | DataSet ds = new questionDAL().GetList(" order by newid()"); 38 | totalTimu = ds.Tables[0].Rows.Count; 39 | DataSet tihaods = new dateConversion().getTihaoData(ds); 40 | tihaoRepeater.DataSource = tihaods; 41 | tihaoRepeater.DataBind(); 42 | title = "随机练习"; 43 | } 44 | 45 | } 46 | Page.DataBind(); 47 | } 48 | } -------------------------------------------------------------------------------- /Code/web.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 说明 2 | ---- 3 | 4 | 信息安全竞赛形式: 5 | * 网络预选赛:各参赛队伍在规定时间内登录指定的网站,以在线答题方式进行,比赛题型分为判断题、单选题和多选题。 6 | * 现场技能赛:以网络对抗、网络通关竞赛形式进行,采取包括攻防、对抗、突破内容的实战演练题目,可能涉及到注入、缓冲区溢出、嗅探、跨站、破解、加解密、信息隐藏等常用计算机对抗攻防手段。 7 | 8 | 信息安全竞赛练习系统是整合往届网络预选赛的真题以及官方样题和题库,以在线答题方式进行,比赛题型分为判断题、单选题和多选题。并且随机编排答案顺序,将成为备赛选手的好系统。 9 | 10 | 信息安全竞赛练习系统分为顺序练习、随机练习、模拟比赛、错题集等多个模块。请尽情的体验系统带给你的快乐吧~ 11 | 12 | 环境 13 | ---- 14 | 15 | ### 开发工具 16 | * Microsoft Visual Studio 2010 17 | * SQL Server 2008 18 | * Adobe Dreamweaver 19 | 20 | ### 客户端 21 | * 各种浏览器 22 | 23 | ### 服务器端 24 | * SQL Server 2008 25 | * .NET 4.0 26 | * IIS 6.0 27 | * Windows Server 2008 28 | 29 | 环境配置 30 | -------- 31 | 32 | ### 数据库配置 33 | * 1、附加数据库到SQL Server 2008中,其目录为`.\Code\App_Data\InformationSecurity.mdf`。 34 | * 2、设置`InformationSecurity`数据库的用户名和密码。 35 | * 3、修改`.\Code\web.config`中`connectionStrings`属性,如下: 36 | 37 | ```C# 38 | 39 | 40 | 41 | ``` 42 | 43 | ### 部署网站 44 | * 1、控制面板 -> 程序和功能 -> 打开或关闭windows功能(左边) -> Internet信息服务。选中如下: 45 | 46 | ![安装IIS](README/01.png) 47 | 48 | * 2、更改系统默认平台(默认是`.NET2.0`,要更改为`.NET4.0`)。 49 | 50 | ![更改系统默认平台](README/02.png) 51 | 52 | * 3、控制面板 -> 管理工具 -> Internet信息服务(IIS)管理器 -> 添加网站(JX3Report)。默认端口号设为80。 53 | 54 | ![部署网站](README/03.png) 55 | 56 | * 4、应用程序池 -> 添加应用程序池。 57 | 58 | ![修改应用程序池](README/04.png) 59 | ![修改应用程序池](README/05.png) 60 | 61 | * 5、点击“默认文档”,设置网站的默认文档。 62 | 63 | ![设置网站的默认文档](README/06.png) 64 | ![设置网站的默认文档](README/07.png) 65 | 66 | 67 | ### 域名配置 68 | * 把`.\Code\App_Code\Comman\settings.cs`中改成您的域名。 69 | 70 | ```C# 71 | string domain = "http://域名:端口号"; //eg.http://www.liuker.xyz,如果端口号是80则可以不用加端口号。 72 | ``` 73 | 74 | 联系方式 75 | -------- 76 | 77 | * E-mail:lt@liuker.xyz 78 | * QQ:2523417411 79 | -------------------------------------------------------------------------------- /README/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/01.png -------------------------------------------------------------------------------- /README/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/02.png -------------------------------------------------------------------------------- /README/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/03.png -------------------------------------------------------------------------------- /README/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/04.png -------------------------------------------------------------------------------- /README/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/05.png -------------------------------------------------------------------------------- /README/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/06.png -------------------------------------------------------------------------------- /README/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/07.png -------------------------------------------------------------------------------- /README/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laucyun/InfoSecPracticeSystem/6bc4cf0280398af97b2189cf404d281f05fc21de/README/08.png --------------------------------------------------------------------------------