
c#
bianjing40
这个作者很懒,什么都没留下…
展开
-
C#反射技术的简单操作
public class A { public int Property1 { get; set; } }static void Main(){ A aa = new A(); Type type = aa.GetType();//获取类型 System.Reflect转载 2015-10-02 16:12:05 · 400 阅读 · 0 评论 -
ASP.NET C#+Ajax+json无刷新分页参考
先html代码 UID 帐号 状态原创 2015-12-15 21:51:05 · 3225 阅读 · 0 评论 -
asp.net遍历request.form 值
for (int i = 0; i if (Request.Form.Keys[i].ToString().Substring(0,1)!="_")Response.Write(Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString());}for(int i = 0;iResponse.Writ转载 2016-12-14 18:08:26 · 8395 阅读 · 1 评论 -
利用反射快速给Model实体赋值
public class BaseModel where T : new() { public static T Init(DataRow dr) { T t = new T(); Type infotype = typeof(T); //获取所有属性 PropertyInfo[] prop转载 2016-12-12 10:09:15 · 1931 阅读 · 0 评论 -
C# List数组创建
List> list = new List>(); Type t1 = typeof(AdminModel); PropertyInfo[] propertys1 = t1.GetProperties(); foreach (PropertyInfo pi in propertys1) { string name = pi.Name; object m_value = t1.GetProper原创 2016-12-12 13:14:20 · 5641 阅读 · 0 评论 -
C# 定时执行一个方法
System.Timers.Timer timer = new System.Timers.Timer(); timer.Enabled = true; timer.Interval = 60000;//执行间隔时间,单位为毫秒 timer.Start(); timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer1_转载 2017-01-09 10:34:54 · 6237 阅读 · 1 评论 -
C#Replace过滤忽略其大小写
string ls_title = "你好世界ABC_abc_Abc_aBC";string wd = "abc";ls_title = System.Text.RegularExpressions.Regex.Replace(ls_title, @"(?is)"+ wd, "" + wd + "");原创 2017-09-15 22:58:48 · 2516 阅读 · 0 评论 -
使用ashx一般处理程序,读取不到Session的问题
public class RandomCode : IHttpHandler, System.Web.SessionState.IRequiresSessionState //这里就是实现的接口 { public void ProcessRequest(HttpContext context) { string checkCode =转载 2016-12-10 21:40:04 · 2002 阅读 · 0 评论