2012年5月5日

c# operator重载

摘要: using System.Windows;namespace Wpftry{ /// <summary> /// OperatorOver.xaml 的交互逻辑 /// </summary> public partial class OperatorOver : Window { public OperatorOver() { InitializeComponent(); } public class Squre { private double width; private double height; public Squre() { width = 100; he 阅读全文

posted @ 2012-05-05 14:04 譕? 阅读(325) 评论(0) 推荐(0) 编辑

匿名方法初学

摘要: 初学,请多指教。在 2.0 之前的 C# 版本中,声明委托的唯一方法是使用命名空间。C# 2.0 引入了匿名方法。要将代码块传递为委托参数,创建匿名方法则是唯一的方法。使用匿名方法就可以实现:不需要创建单独的方法,再去供委托调用。例子: ///这是未使用匿名方法的类; public class delmethon1 { delegate void Somedelegate(); public static void method() ///为了方便:使用static { Somedelegate del = new Somedelegate(somemethod); del(); }... 阅读全文

posted @ 2012-05-05 10:40 譕? 阅读(133) 评论(0) 推荐(0) 编辑

2012年3月25日

获取数据库的表中一个值

摘要: 把这个19 转成int类型 List<object> one = new List<object>(); one.Add(new XQsys.BLL.News().SelectNewslastID()); int id = Convert.ToInt32(one[0]);方法二: SqlConnection conn = sqlhelp.createcon(); SqlCommand com = new SqlCommand(); com.CommandType = CommandType.Text; com.CommandText = "select Use 阅读全文

posted @ 2012-03-25 00:38 譕? 阅读(183) 评论(0) 推荐(0) 编辑

DataTabe转JSON

摘要: 代码附上:public static string DataTableToJSON(DataTable dt, string dtName) { StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); using (JsonWriter jw = new JsonTextWriter(sw)) { JsonSerializer ser = new JsonSerializer(); jw.WriteStartObject(); jw.WritePropertyName(dtName); jw 阅读全文

posted @ 2012-03-25 00:26 譕? 阅读(131) 评论(0) 推荐(0) 编辑

jquery获取链接地址的值

摘要: 代码附上:function request(paras) { var url = location.href; var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&"); var paraObj = {} for (i = 0; j = paraString[i]; i++) { paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf( 阅读全文

posted @ 2012-03-25 00:17 譕? 阅读(549) 评论(2) 推荐(0) 编辑

AuthenticationCode验证码的使用

摘要: 1:将该插件的引用到项目中2:在工具箱里拖控件 3:验证控件: string sess; sess = (string)HttpContext.Current.Session["AuthenticationCode"]; 如果在.axsh中使用这控件需要添加 1: using System.Web.SessionState; 2:在IHttpHandler后添加 IRequiresSessionState 阅读全文

posted @ 2012-03-25 00:07 譕? 阅读(338) 评论(0) 推荐(0) 编辑

2012年3月24日

jquerypage插件

摘要: 使用 JqueryPage插件时1:在项目中添加插件的JS文件2:在需要显示的页面添加JS文件的引用<script src="···/jquerypage.js" type="text/javascript"></script> jquery : <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>3: 在显示页面的区域添加HTML标签: &l 阅读全文

posted @ 2012-03-24 23:29 譕? 阅读(167) 评论(0) 推荐(0) 编辑

导航