摘要:
static class TestExtend { /// /// 判断是否有重复添加 /// /// /// /// /// /// public static void AddSingle(this Dictionary dict, Tkey key, TValue value) { if (!dict.ContainsKey(key)) { dict... 阅读全文
摘要:
[HttpPost] public ActionResult AddMsg(MsgModel model) { string strSql = "insert into tbl_msg(title,msg,msg_by,msg_date,status) values(@title,@msg,@msg_by,getdate(),'A')"; SqlParameter[] paramter ={ new SqlParameter("@title",SqlDbType.NVarCha... 阅读全文
摘要:
public ActionResult GetList() { string strSql = "select staff_id,nick_name from tbl_ac_info where status='A'"; SqlDataReader sdr = SqlDbHelper.GetSqlDataReader(strSql); List 阅读全文
摘要:
(1)输出单一变量:当前时间:@DateTime.Now(2)输入HTML:@:这是HTML项(3)C#与HTML混合,输出多行HTML文本时 html文本。。,该标签在前台并没有标识输出(4)@输出:版权所有jacky@@126.com版权所有jacky@126.com(5)C#与HTML混合,多行C#代码:@{}@{ var a = "中国人民解放军"; var msg = "打印文本框中:" + a; @Html.TextBox("txtPrint", msg, new {style="border:solid 1px 阅读全文
摘要:
declare @date datetime;set @date = getdate()--思路,指定日期是当年的第几周-给定日期所在月第一天是当年的第几周select datepart(week,@date)-datepart(week,dateadd(month,datediff(month,0,@date),0))+1 [week_month]select datepart(week,@date)-datepart(week,dateadd(day,1-datepart(day,@date),@date))+1 [week_month] 阅读全文
摘要:
验证数字:^[0-9]*$验证n位的数字:^\d{n}$验证至少n位数字:^\d{n,}$验证m-n位的数字:^\d{m,n}$验证零和非零开头的数字:^(0|[1-9][0-9]*)$验证有两位小数的正实数:^[0-9]+(.[0-9]{2})?$验证有1-3位小数的正实数:^[0-9]+(.[0-9]{1,3})?$验证非零的正整数:^\+?[1-9][0-9]*$验证非零的负整数:^\-[1-9][0-9]*$验证非负整数(正整数 + 0) ^\d+$验证非正整数(负整数 + 0) ^((-\d+)|(0+))$验证长度为3的字符:^.{3}$验证由26个英文字母组成的字符串:^[A-Z 阅读全文
摘要:
public class StudentModel { [Display(Name="学生编号")] public int StuId { set; get; } [Required(ErrorMessage="请输入学生姓名!")] [StringLength(10,ErrorMessage="姓名长度不能长于10!")] [Display(Name="学生姓名")] [Remote("ValirStuName","Student",HttpMethod="Pos 阅读全文
摘要:
class Program { static void Main(string[] args) { string str = Console.ReadLine(); Console.WriteLine(ReverseByFun(str)); Console.WriteLine(ReverseByArray(str)); } /// /// 方法一 /// /// 待反转字符串 /// ... 阅读全文
摘要:
在MVC2中是默认不启用客户端验证(在MVC3及以后的版本,是默认启用),首先在Web.config中配置,并在视图中引入jQuery验证库 阅读全文
摘要:
http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/Series.aspxhttp://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/Series/EntLib.aspxhttp://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/Series/ASPNET_MVC2.aspxhttp://msdn.microsoft.com/zh-cn/jj889437 ... 阅读全文