上一页 1 ··· 345 346 347 348 349 350 351 352 353 ··· 361 下一页
摘要: 为string类型,加一个扩展方法,IsNullOrEmpty,事实上.net已经把这个扩展方法集成了还可以设计一个过滤Email的扩展方法class Program{ static void Main(string[] args) { string newString = null; if (newString.IsNullOrEmpty()) { // Do Something } }}public static class Extensions{ public static bool IsNullOrEmpty(this string s) { return (s == null || 阅读全文
posted @ 2011-06-23 17:13 张占岭 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 预备知识,下面语句用来查询指定路径下的access数据表SELECT NEWID() , *FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source="C:\Documents and Settings\Administrator\My Documents\Database1.mdb";User ID=;Password=;')...userbases go注意,如果希望执行上面语句,还要开启这个服务才行:如果希望批量插入,只要加上insert 就OK了看代码:INSERT INT 阅读全文
posted @ 2011-06-22 11:45 张占岭 阅读(728) 评论(0) 推荐(0) 编辑
摘要: 部分类相信大家都用过,即对于团队开发时,如果共同完成一个功能,又不想破坏类的完整性,我们就可以引用部分类,在winform和webform自建的程序中,microsoft也是这样实现的.再使用部分类时没什么可说的,但在使用部分类里的部分方法时却有一些需要注意的幼!看代码: /// <summary> /// 部分类和部分方法 /// </summary> public partial class users { public string Result1 { get; private set; } public string Result2 { get; private 阅读全文
posted @ 2011-06-21 17:59 张占岭 阅读(367) 评论(0) 推荐(0) 编辑
摘要: controller代码: public ActionResult UploadPicture() {return Content("ok"); // return Content("{result:'" + imgMsg + "',url:'" + imgUrl + "'}"); //本行是反回json格式的字符 }AJAX代码: $.ajax({ type: "POST", url: "/ClassBasic/UploadPicture", 阅读全文
posted @ 2011-06-21 17:35 张占岭 阅读(5623) 评论(5) 推荐(0) 编辑
摘要: ASPX文件<table id="list"> <thead> <tr> <td> ID </td> <td> 用户名 </td> <td> 建立日期 </td> </tr> </thead> <tbody> <%foreach (var userbase in ModeluserBase) { %> <tr> <td> <%=userbase.UserID %> </td> 阅读全文
posted @ 2011-06-21 13:37 张占岭 阅读(627) 评论(0) 推荐(0) 编辑
上一页 1 ··· 345 346 347 348 349 350 351 352 353 ··· 361 下一页