
.NET
Amiao999
这个作者很懒,什么都没留下…
展开
-
图片列表页显示
if (!IsPostBack) { Dqt.Reporter.BLL.user userbll = new Dqt.Reporter.BLL.user(); int pageSize = 32; int pageindex = 1; if (!string.IsNullOrEmpty(原创 2014-05-03 21:12:48 · 602 阅读 · 0 评论 -
修改密码
scripttype="text/javascript"> $(function () { $("#btnsub").click(function() { var old = $("#txtoldp原创 2014-05-03 16:23:18 · 504 阅读 · 0 评论 -
统计各表中指定条件记录数量
Dqt.Reporter.BLL.school schoolbll = new Dqt.Reporter.BLL.school(); Dqt.Reporter.BLL.user userbll = new Dqt.Reporter.BLL.user(); Dqt.Reporter.BLL.article articlebll=new Dqt.Reporter.B转载 2014-05-04 11:02:20 · 468 阅读 · 0 评论 -
图片上传
图片上传protected void Button1_Click(object sender, EventArgs e) { Dqt.Reporter.Model.school schoolModel = new Dqt.Reporter.Model.school(); if (fuIcon.HasFile) {转载 2014-05-03 16:15:36 · 517 阅读 · 0 评论 -
绑定类别的方法
取得类别的方法:绑定控件时先实new一个相应的BLL,然后通过GetModelList()方法,取得list列表后绑到控件上private void GetClass() { Dqt.Reporter.BLL.article_class classbll = new Dqt.Reporter.BLL.article_class(); List artic原创 2014-05-03 16:25:13 · 398 阅读 · 0 评论 -
判断是否重复录入
Dqt.Reporter.Model.user UserModel = new Dqt.Reporter.Model.user(); List userlist = UserBLL.GetModelList("UserName='" + this.TxtUserName.Text.Trim() + "'"); if (userlist.Count > 0)原创 2014-05-04 14:26:12 · 498 阅读 · 0 评论 -
根据出生日期得到年龄
public string GetAge(long l) { if (l == 0) return "未设置"; DateTime dt1 = DateTime.Parse(Dqt.Reporter.Common.Util.UnixTimeToTimes(l.ToString(), "yyyy-MM-dd HH:mm:ss"));原创 2014-05-04 14:21:07 · 529 阅读 · 0 评论 -
PageBase 基本用法
UserType = "reg"; int.TryParse(id, out Uid); UserName = HttpUtility.UrlDecode(UserName); } if (Uid { UserName原创 2014-05-04 15:04:33 · 1322 阅读 · 0 评论 -
内容显示页调用方法
Cs代码内容页需要得到一个spublic partialclass gaojian_view: System.Web.UI.Page{ Dqt.Reporter.BLL.articleArtcileBLL =new Dqt.Reporter.BLL.article(); protected int ArticleId = 0; protectedD原创 2014-05-03 16:48:24 · 416 阅读 · 0 评论 -
Pages()//无条件分页
public List Pages()//无条件分页 { int pageSize = 10;//每页10条 int pageindex = 1; if (!string.IsNullOrEmpty(Request.QueryString["page"])) pageindex = int.Parse(Request.Quer转载 2014-05-04 14:13:28 · 895 阅读 · 0 评论 -
接收ID并处理方法
//过ihc if (string.IsNullOrEmpty(Request.QueryString["ArticleId"]) &&Dqt.Reporter.Common.MFunction.IsSaveStr(Request.QueryString["ArticleId"])) return; if (int.TryParse(R原创 2014-05-03 16:40:08 · 626 阅读 · 0 评论 -
取得当前时间换算成为Mysql中取得的Unix时间
logmodel.CreateTime = Dqt.Reporter.Common.Util.TimeToUnixTimes(DateTime.Now.ToString());原创 2014-05-04 14:33:01 · 590 阅读 · 0 评论 -
得到某一用户的稿件总数
//得到某一用户的稿件总数 public int ThreadCount(int uid) { return threadbll.GetRecordCount("ArticlUser=" + uid); }原创 2014-05-04 14:39:31 · 337 阅读 · 0 评论 -
根据Mysql中取得的Unix时间换算成为指定格式的时间
this.TxtArticlTime.Text = Dqt.Reporter.Common.Util.UnixTimeToTimes(ArticleModel.ArticlTime.ToString());转载 2014-05-04 14:50:24 · 578 阅读 · 0 评论 -
提示弹窗
Dqt.Reporter.Common.jsHint.Refresh("请填写内容!");转载 2014-05-03 16:17:45 · 449 阅读 · 0 评论 -
用来判断是否重复录入
List userlist = UserBLL.GetModelList("UserName='" + this.TxtUserName.Text.Trim()+ "'"); if(userlist.Count > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"转载 2014-05-03 16:20:11 · 526 阅读 · 0 评论 -
文章点击数加1
//文章点击数加1 private void AddClickNum() { ArticleModel.ArticlDianJiShu =++ArticleModel.ArticlDianJiShu; ArticleBLL.Update(ArticleModel); }原创 2014-05-03 16:42:36 · 616 阅读 · 0 评论 -
Pages() 附加条件分页
public List Pages() { string strWhere = "1=1"; string fudai = string.Empty; if (!string.IsNullOrEmpty(Request.QueryString["sport"])) { if (MFunction.IsS原创 2014-05-04 14:16:33 · 1006 阅读 · 0 评论 -
GridView指定列显示出其他表统计数值
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onMouseOver"原创 2014-05-04 11:16:31 · 622 阅读 · 0 评论 -
正则判断邮件格式
string Email = this.txtemial.Text.Trim(); Regex reg = new Regex(@"^\w{1,}.{0,}\w{1,}@\w+(\.\w+)+$"); if (!reg.IsMatch(Email)) { Page.ClientScript.RegisterClient原创 2014-05-04 19:56:29 · 304 阅读 · 0 评论 -
取用户IP
UserModel.LastLoginIp = Request.UserHostAddress;原创 2014-05-04 20:08:57 · 388 阅读 · 0 评论 -
退出,清空cookie
//退出 if (Request.QueryString["t"] == "out") { HttpCookie myCookie = new HttpCookie("dqtxjz"); myCookie.Expires = DateTime.Now.AddDays(-1);原创 2014-05-04 20:14:55 · 3157 阅读 · 0 评论 -
list<Model>判断用户是否存在,取出model只修改指定值
Dqt.Reporter.BLL.user UserBLL = new Dqt.Reporter.BLL.user(); Dqt.Reporter.Model.user UserModel = new Dqt.Reporter.Model.user(); List userlist = UserBLL.GetModelList("(UserNam原创 2014-05-04 20:20:38 · 1859 阅读 · 1 评论 -
用户登录过程
protected void Button1_Click(object sender, EventArgs e) { if (this.txt_user_name.Text.Trim() == "" || this.txt_user_pwd.Text.Trim() == "") { return; }原创 2014-05-04 20:25:28 · 811 阅读 · 0 评论 -
UEeditor修改绑定内容
var editor = UE.getEditor('container', { initialFrameWidth: 628, initialContent: '' });原创 2014-05-04 21:14:41 · 1153 阅读 · 0 评论 -
关键字查询并分页
public List Pages()//无条件分页 { string strWhere = "1=1"; string fudai = string.Empty; if (!string.IsNullOrEmpty(Request.QueryString["sport"])) { if (原创 2014-05-04 21:24:29 · 962 阅读 · 0 评论 -
分页控件page源码
{0}{1}{2}{3}{4}{5}转载 2014-05-04 21:27:53 · 396 阅读 · 0 评论 -
学校排行,前3个红色序号
学校排行 3?"cologray":"clolrp" %>">" style="font-size: 13px;"> 15 ? Eval("Sname").ToString().Substring(0, 15) + "..原创 2014-05-04 21:44:15 · 677 阅读 · 0 评论 -
判断邮箱是否存在
List userlist = UserBLL.GetModelList("Email='" + Email + "'"); if (userlist.Count > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('邮箱已经存在,请原创 2014-05-04 20:06:50 · 1038 阅读 · 0 评论 -
Ajax修改密码
//修改密码的时候是 Dqt.Reporter.BLL.user usebll = new Dqt.Reporter.BLL.user(); Dqt.Reporter.Model.user usemodel = new Dqt.Reporter.Model.user(); if (MFunction.IsSaveStr(原创 2014-05-04 20:40:12 · 622 阅读 · 0 评论 -
前台字段绑定,变量绑定
字段xd 学校地址:原创 2014-05-05 16:55:48 · 406 阅读 · 0 评论 -
防SQL注入方法
public static bool IsSaveStr(string inputString) { string SqlStr = @"and|or|exec|execute|insert|select|delete|update|alter|create|drop|count|\*|chr|char|asc|mid|substring|master|tr转载 2014-05-06 16:31:14 · 582 阅读 · 0 评论 -
判断接收值是否为纯数字
if (Dqt.Reporter.Common.Util.IsDigit(Request.QueryString["edit"])) { if (int.TryParse(Request.QueryString["edit"], out editid)) { amodel = ArticleBLL.Ge原创 2014-05-06 16:41:31 · 930 阅读 · 0 评论 -
.net前台页面提示弹窗
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"","alert('内容太长请缩减')",true);原创 2014-05-06 16:36:19 · 764 阅读 · 0 评论 -
vs编译时出错:虚拟目录 无法映射
改为:原创 2014-05-06 10:36:10 · 566 阅读 · 0 评论 -
BLL DAL List四个参数重载方法
public List GetModelList(string strWhere, int pageNo, int pageSize, string orderBy) { DataSet ds = dal.GetList(strWhere, pageNo, pageSize, orderBy); return DataTable转载 2014-05-16 11:53:01 · 738 阅读 · 0 评论 -
去掉aspx页面一大堆乱码方法
原创 2014-05-16 14:34:42 · 343 阅读 · 0 评论 -
字段值加1
//增加school表小记者数 public void UpXjzNums(int Sid) { Dqt.Reporter.Model.school model = schoolBll.GetModel(Sid); if (model != null) { model.XjzNums = ++model.Xjz原创 2014-05-19 08:37:20 · 550 阅读 · 0 评论 -
用VS2010建立空白解决方案
三层结构,会有多个项目。为了让各项目之间的关系反映在目录结构上所以要建立一个解决方案。 1.建立解决方案: 文件->新建项目->其它项目类型->Visual Studio解决方案->空白解决方案。 2.在解决方案里添加第一个项目 建立空白解决方案后,在vs2010右边的解决方案资源管理器中,可以看到刚建立的解决方案,单击选中它,然后右键选择“添加”->新建项目 ->Visu转载 2014-05-13 10:15:42 · 3571 阅读 · 0 评论 -
前台调用类库中自定义方法关系图
原创 2014-05-13 11:35:14 · 349 阅读 · 0 评论