摘要: 第一种:全局异常处理1.首先常见保存异常的类(就是将异常信息写入到文件中去) public class LogManager { private string logFilePath = string.Empty; public LogManager(string logFilePath) { this.logFilePath = logFilePath; FileInfo file = new FileInfo(logFilePath); if (!file.Exists) { file.Create().Close... 阅读全文
posted @ 2013-07-30 22:12 jeffrey77 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-07-30 11:44 jeffrey77 阅读(369) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;using System.Net;using System.Management;using System.Runtime.InteropServices;namespace JM.Common.Net{ /// /// 基础网络类 /// public class BaseNet { /// /// 获取本地IP地址 ... 阅读全文
posted @ 2013-07-29 16:18 jeffrey77 阅读(262) 评论(0) 推荐(0) 编辑
摘要: public class MessageBox { /// /// 自定义弹出窗口内容,不跳转 /// /// /// public static void Show(System.Web.UI.Page page, string msg) { page.ClientScript.RegisterStartupScript(page.GetType(), "ShowMessage", "alert('" + msg + "');", true); ... 阅读全文
posted @ 2013-07-29 14:23 jeffrey77 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1. C# 代码风格要求1.1注释类型、属性、事件、方法、方法参数,根据需要添加注释。如果类型、属性、事件、方法、方法参数的名称已经是自解释了,则不需要加注释;否则必须添加注释。当添加注释时,添加方式如下图所示:1.2 类型(类、结构、委托、接口)、字段、属性、方法、事件的命名优先考虑英文,如果英文没有合适的单词描述,可以使用拼音,不得出现中文。唯一可以使用中文的地方是枚举的枚举项,枚举项实际已经不属于本节标题的范畴了。这里只是放到一起说明,如下图所示:1.3 不使用缩写所有类型、方法、参数、变量的命名不得使用缩写,包括大家熟知的缩写,例如msg。1.4 代码使用半展开第一步,打开Visual 阅读全文
posted @ 2013-06-05 21:41 jeffrey77 阅读(126) 评论(0) 推荐(0) 编辑
摘要: //获取所有属性值 var item = $("select[@name=items] option[@selected]").text(); $('select[name="selectName"]').each( function(){ alert($(this).val()); });jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关获取一组radio被选中项的值var item = $('input[@name=items][@checke 阅读全文
posted @ 2013-06-05 20:48 jeffrey77 阅读(243) 评论(0) 推荐(0) 编辑
摘要: IE6双倍边距问题在IE6中查看时,却会发现左侧外边距100像素,被扩大到200个像素,加上display: inline可解决;.floatbox { float: left; width: 150px; height: 150px; margin: 5px 0 5px 100px; display: inline; }解决IE6不支持position:fixed;属性常规 position:fixed; 实现方法 例:右下角 <div id="top">...</div> 这个 HTML 元素使用的 CSS 代码如下: #top{ positio 阅读全文
posted @ 2013-05-03 21:38 jeffrey77 阅读(224) 评论(0) 推荐(0) 编辑
摘要: ///四舍五入public double transmitNum(double f){ if((f-(int)f)<=0.5&&(f-(int)f>0)) return (int)f+0.5; if((f-(int)f)>0.5) return (int)f+1.0; if((f-(int)f)==0) return f; return f;} 阅读全文
posted @ 2013-04-19 14:19 jeffrey77 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 修改某字段的默认值:alter table dbo.aspnet_Users add default getdate() for LastActivityDate alter table dbo.aspnet_Users add default newid()for UID修改某字段的类型:alter table 表名 alter column 列名 nvarchar(500) 阅读全文
posted @ 2013-04-07 21:27 jeffrey77 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 不同的浏览器对CSS的解释都有一点出入,特别是padding, line-height这些要细微控制的地方,下面的hack基本可以解决这个问题:• 在属性前加下划线(_),那么此属性只会被IE6解释• 在属性前加星号(*),此属性只会被IE7解释• 在属性值后面加"\9",表示此属性只会被IE8解释各浏览器CSS hack兼容表:IE6IE7IE8FirefoxChromeSafari!importantYY_Y*YY*+Y\9YYY\0Ynth-of-type(1)YY#test{color:red; /* 所有浏览器都支持 */color:red !important; 阅读全文
posted @ 2013-02-28 11:54 jeffrey77 阅读(143) 评论(0) 推荐(0) 编辑