随笔分类 - ASP.NET技术专题
摘要:1 DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 html xmlns="http://www....
阅读全文
摘要:1、左连接:var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals dept.ID into JoinedEmpDept from dept in JoinedEmpDept.DefaultIfEmpty() select new { EmployeeName = emp.Name, DepartmentName = dept != null ? dept.Name : null };2、右连接:var RightJoin = from dept in ListO
阅读全文
摘要://统计今日 startDate = DateTime.Now.ToString("yyyy-MM-dd 00:00:00"); //统计本周 startDate = DateTime.Now.AddDays(DayOfWeek.Monday - DateTime.Today.DayOfWeek).ToString("yyyy-MM-dd 00:00:00"); //统计本月 startDate = DateTime.Now.ToString("yyyy-MM-01 00:00:00");
阅读全文
摘要:/// /// 获取一个类指定的属性值 /// /// object对象 /// 属性名称 /// public static object GetPropertyValue(object info, string field) { if (info == null) return null...
阅读全文
摘要:1 namespace shendeng.lottery.helper 2 { 3 public class ControllerHelper 4 { 5 /// 6 /// 取出公告 7 /// 8 /// 9 public static List GetNewList...
阅读全文
摘要:if ( MessageBox.Show("要重新启动嘛?","提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) System.Diagnostics.Process.Start(...
阅读全文
摘要:在ASP.net开发中如果想要实现图片找不到时显示默认图片的功能,我们有以下几种方法: 1。js 可以获得页面上每个image标签的对象。然后再设置它的src属性就ok了。 代码
阅读全文
摘要:xml配置文件: fujian fujian_zyz fujian_sql_zyz false 操作类的实现: using System;using System.IO;using System.Web;using System.Text;using System.Xml.Serializati...
阅读全文
摘要:经常有人请我指导应该如何动态地“重写”URL,以在他们的ASP.NETweb应用中发布比较干净的URL端点。这个博客帖子概述了几个方法,你可以用来在ASP.NET中干净地映射或重写URL,以及按照你自己的需求组织你的URL的结构。 为什么URL映射和重写很重要? 下面是开发人员想要对URL有更大的灵...
阅读全文
摘要:密码框样式引入命名空间 xmlns:sys="clr-namespace:System;assembly=mscorlib" 1 265 266
阅读全文
摘要:1 "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 "http://www.w3.org/1999/xhtml"> 3 4 "Con...
阅读全文
摘要:第一步:创建一个类,并集成自IRouteHandler,实现接口中的方法. 第二步:在Application_Start中注册Route 第三步:配置Web.Config: 1.在中添加 httpModules> addname="UrlRoutingModule"type="System.Web....
阅读全文
摘要:第1种用 Task类. 推荐用这个办法 publicvoid 工作_Task(){Dispatcher x = Dispatcher.CurrentDispatcher;//取得当前工作线程//另开线程工作Taskint> 计数 =new Taskint>(() => { return 计数方...
阅读全文
摘要:1. 下载Html Agility Pack,解压保存到本地 下载地址:http://htmlagilitypack.codeplex.com/ 1 void caijisoufun() 2 { 3 try 4 { 5 6 HtmlAgilityPack.HtmlDocument doc = ...
阅读全文
摘要:在项目中可能用到如下表格式结构: DataGrid绑定好象没有此功能,因此自己定义了一个MyGrid代码如下: 自己定义一个UserControl,在其中添加一人Grid控件然后设置行和列如下: UserControlx:Class= Hahaman.UI.MyGrid xmlns= http:/...
阅读全文
摘要:导航.简单的理解可以是从一个页面跳转到另外一个页面。在传统的ASP.NET网站中这种效果很容易实现。而在Silverlight中我们也同样可以,我们有两种方法来实现这个效果。 第一个选择是使用代码更改页面视图(修改容器Content属性),移除/添加User Control来实现导航,这个方法比较简...
阅读全文
摘要:http://code.google.com/p/leveldb/ MongoDB
阅读全文
摘要:一、 获取远程页面数据请求方法 /// /// 获取远程服务器页面文件 /// /// 访问地址 /// 编码格式 /// string public string GetStringByUrl(string Url, System.Text.Encoding encoding) { if...
阅读全文
摘要:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 通过访问http://m.weather.com.cn/data5/city.xml得到一级列表(省、直辖市、自治区)通过访问http://m.weather.com.cn/da...
阅读全文
摘要:1 /** 2 * 手机号码 3 * 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188 4 * 联通:130,131,132,152,155,156,185,186 5 * 电信:133,1349,153,180,189 ...
阅读全文