![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Asp.Net c#
今天的现在
这个作者很懒,什么都没留下…
展开
-
ASP.Net中的MD5加密
public string md5(string str, int code) { if (code == 16) //16位MD5加密(取32位加密的9~25字符) { return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile转载 2013-08-02 16:09:29 · 727 阅读 · 0 评论 -
C#取整函数Math.Round、Math.Ceiling和Math.Floor
1.Math.Round:四舍六入五取偶引用内容Math.Round(0.0) //0Math.Round(0.1) //0Math.Round(0.2) //0Math.Round(0.3) //0Math.Round(0.4) //0Math.Round(0.5) //0Math.Round(0.6) //1Math.Round(0.7) //1Math.Round(0...转载 2018-08-27 12:18:56 · 1087 阅读 · 0 评论 -
c# 求两个时间相差多少分钟数
法一、使用TimeSpan ,同时也介绍一下TimeSpan的用法相关属性和函数Add:与另一个TimeSpan值相加。Days:返回用天数计算的TimeSpan值。Duration:获取TimeSpan的绝对值。Hours:返回用小时计算的TimeSpan值Milliseconds:返回用毫秒计算的TimeSpan值。Minutes:返回用分钟计算的TimeSpan值。Negat...转载 2018-08-16 17:58:36 · 21798 阅读 · 0 评论 -
c#的DateTime.Now函数详解
//2008年4月24日 System.DateTime.Now.ToString("D"); //2008-4-24 System.DateTime.Now.ToString("d"); //2008年4月24日 16:30:15 System.DateTime.Now.ToString("F"); //2008年4月24日转载 2013-07-27 10:48:53 · 457 阅读 · 0 评论 -
C# 无法将类型为“System.DBNull”的对象强制转换为类型“System.String”。
if (row["name"] != System.DBNull.Value) { s_uname = (string)row["name"]; }原创 2013-08-01 21:10:49 · 7159 阅读 · 0 评论 -
DropDownList的动态绑定与取默认值
DropDownList1.DataSource = ds; //绑定数据源DropDownList1.DataTextField = "TypeName"; //文本内容字段DropDownList1.DataValueField = "TypeId"; //值字段DropDownList1.DataBind();ds.Dispose(); 取默认值DropDownL原创 2013-07-30 22:57:59 · 1016 阅读 · 0 评论 -
动软生成的GetListByPage行数的算法
int i_inde, i_end; i_end = 当前页码 * 每页显示多少条; i_inde = (当前页码 - 1) * 每页显示多少条+ 1;原创 2013-07-26 12:50:58 · 2255 阅读 · 0 评论 -
在C#中使用Response.write返回的内容不要HTML
Response.Clear(); Response.Write("");Response.Flush();Response.End();原创 2013-07-27 12:26:40 · 5061 阅读 · 0 评论 -
用DateTime.ToString(string format)输出不同格式的日期
DateTime.ToString()函数有四个重载。一般用得多的就是不带参数的那个了。殊不知,DateTime.ToString(string format)功能更强大,能输出不同格式的日期。以下把一些情况罗列出来,供大家参考。有些在MSDN上有的就没有列出来了。1. y代表年份,注意是小写的y,大写的Y并不代表年份。2. M表示月份。3.转载 2013-07-30 11:50:49 · 779 阅读 · 0 评论 -
winform中的DataGridView的列宽设置(自动调整列宽)
找了很多都说DataGridView有一个属性AutoSizeColumnMode,他有很多枚举值:1、AllCells 调整列宽,以适合该列中的所有单元格的内容,包括标题单元格。 2、AllCellsExceptHeader 调整列宽,以适合该列中的所有单元格的内容,不包括标题单元格。 3、ColumnHeader 调整列宽,以适合列标题单元格的内容。 4、DisplayedCe...转载 2018-08-27 21:59:07 · 21375 阅读 · 0 评论