随笔分类 -  Dot NET

1 2 下一页
TF42064: The build number already exists for build definition error in TFS2010
摘要:In TFS2008, deleting a build removes it from the database itself. If you delete a build called Build_20110423.1 or 1.0.0.1 from Build Explorer and tri... 阅读全文
posted @ 2014-12-21 19:15 Peter Zhang 阅读(601) 评论(0) 推荐(0)
获取系统闲置时间
摘要:http://www.pinvoke.net/default.aspx/user32.GetLastInputInfo[StructLayout(LayoutKind.Sequential)]public struct LASTINPUTINFO{ [MarshalAs(UnmanagedType.U4)] public int cbSize; [MarshalAs(UnmanagedTyp... 阅读全文
posted @ 2012-08-27 14:17 Peter Zhang 阅读(727) 评论(0) 推荐(0)
.NET 程序内存占用问题
摘要:1、使用性能测试工具dotTrace 3.0,它能够计算出你程序中那些代码占用内存较多 2、强制垃圾回收 3、多dispose,close 4、用timer,每几秒钟调用:SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);具体见附录。 5、发布的时候选择Release 6、注意代码编写时少产生垃圾,比... 阅读全文
posted @ 2012-08-27 09:54 Peter Zhang 阅读(4273) 评论(1) 推荐(0)
WCF FAQs
摘要:(1)同一个协定中不能存在两个名称相同的操作 WCF 服务契约中的操作名称不能重复,如果有重载的话需要为重载的操作起一个别名,如以下代码: /// <summary>/// 通用契約/// </summary>[ServiceContract]public interface ICommon{ [OperationContract] string GetAuthorName(stri... 阅读全文
posted @ 2011-09-08 14:23 Peter Zhang 阅读(655) 评论(0) 推荐(0)
CompressionModule
摘要:优点:开放源代码,强大的自定义功能,能压缩多种资源,能完美支持各种ajax框架!缺点:使用复杂,仅支持asp.net2.0或以上版本!http://www.codeproject.com/KB/aspnet/httpcompression.aspx 将DC.Web.HttpCompress.dll放到网站项目的bin目录,再按如下增加及修改项目的web.config <configSectio... 阅读全文
posted @ 2011-08-22 13:23 Peter Zhang 阅读(431) 评论(0) 推荐(0)
导出EXCEL UpdatePanel出错
摘要:加入UpdatePanel后导出EXCEL出错,需要在UpdatePanel的Trigger标记中加入 <asp:PostBackTrigger ControlID="btnExport" /> 使用 PostBackTrigger 控件可使 UpdatePanel 内部的控件导致回发,而不是执行异步回发。 完整代码如下 <asp:UpdatePanel ID="updatePanelExpor... 阅读全文
posted @ 2011-08-16 10:35 Peter Zhang 阅读(354) 评论(0) 推荐(0)
关于 AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. 错误
摘要:错误: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in Aja... 阅读全文
posted @ 2011-08-14 22:05 Peter Zhang 阅读(581) 评论(0) 推荐(0)
IE CSS文件限制
摘要:doc.createStyleSheet() invalid argument exception Internet Explorer (IE for short) imposes some CSS file limitations that may directly affect page rendering. Below is a list of known CSS file limitati... 阅读全文
posted @ 2011-08-14 09:54 Peter Zhang 阅读(922) 评论(0) 推荐(0)
[转]MSBuild入门
摘要:如果你和我一样一直都在用NAnt管理生成过程的话,那么你一定会高度关注MSBuild。原因很简单,因为它属于微软,你可以不喜欢它,但你一定要学会用它。 在熬过了几个晚上以后,我终于让自己适应了MSBuild的语法。这可真不容易,特别是当自己已经习惯了NAnt的小写规范之后。不过这不成问题,因 为随着自己对MSBuild的理解一点点加深,自己还真的喜欢上它了。 好吧,下面就让我来简单地介绍一下我... 阅读全文
posted @ 2010-06-21 17:00 Peter Zhang 阅读(812) 评论(0) 推荐(0)
[WWF] 开篇
摘要:WWF简介Download Windows Workflow Foundation (WWF)是编程模型,引擎和工具,用于在Windows上快速生成启动工作流的应用程序.它包括一个命名空间、一个进程内工作流引擎和多个Visual Studio 2005设计器。Windows Workflow Foundation是一个框架,让用户可以在其为Windows Vista、Windows XP和Wind... 阅读全文
posted @ 2010-05-31 18:24 Peter Zhang 阅读(1204) 评论(1) 推荐(0)
[Enterprise Library]开篇
摘要:在EntLib 4发布前夕,P&P团队已经在codeplex上公布了相关Unity的计划及其CTP版本,其他的 Application Block也陆续迁移到Unity之上。虽然EntLib只是整个.NET开源的沧海一粟,但其风向标意义明显,其企业级特性支持可以直接用于.NET Native的WCF,而对对象的管理则全部交给Unity完成,这个组合不仅可以向上贯通微软一系列服务器产品,也可... 阅读全文
posted @ 2010-05-25 23:12 Peter Zhang 阅读(259) 评论(0) 推荐(0)
[转]jQuery Intellisense in VS 2008
摘要:Last month I blogged about how Microsoft is extending support for jQuery. Over the last few weeks we've been working with the jQuery team to add great jQuery intellisense support within Visual Studio ... 阅读全文
posted @ 2010-04-15 11:17 Peter Zhang 阅读(342) 评论(0) 推荐(0)
[转].NET中Cache用法分析
摘要:Cache用法之页面声明 <%@ outputCacheDuration="#ofseconds"Location="Any|Client|Downstream|Server|None"VaryByControl="ControlName"VaryByCustom="browser|customstring"VaryByHeader="headers"VaryByParam="Paramet... 阅读全文
posted @ 2010-04-13 10:46 Peter Zhang 阅读(1119) 评论(0) 推荐(0)
[转].net中Cache的应用
摘要:为了更快的读取数据,我们一般会把常用到的数据加载到Cache中 在.NET中,Cache的存在可以依赖多中方式,主要用到HttpContext.Current.Cache类 在这里,我主要写几种依赖方式 1:不依赖任何条件 HttpContext.Current.Cache.Insert(string cacheName,object obj) 理论上是Cache会永久保存,但是当服务器重新启动,... 阅读全文
posted @ 2010-04-13 10:44 Peter Zhang 阅读(5589) 评论(0) 推荐(2)
NHibernate 执行存储过程
摘要:前置条件: 已经获取了ISession类型的对象: this._session 已经建立一个存储过程: proc_name, 该存储过程有两个参数: para1:varchar 类型,传入参数 para2:number类型,传出参数 int result = 0; IDbCommand cmd = this._session.Connection.CreateCommand(); cmd.Co... 阅读全文
posted @ 2010-03-23 09:03 Peter Zhang 阅读(1981) 评论(1) 推荐(0)
ASP.NET 輸出EXCEL文件
摘要:Response.Buffer= true; Response.Charset="utf-8";//下面这行很重要, attachment 参数表示作为附件下载,您可以改成 online在线打开//filename=FileFlow.xls 指定输出文件的名称,注意其扩展名和指定文件类型相符,可以为:.doc || .xls || .txt ||.htm Response.AppendHeader... 阅读全文
posted @ 2010-02-19 19:19 Peter Zhang 阅读(284) 评论(0) 推荐(0)
Google Weather API Feed Documentation
摘要:The base URL:http://www.google.com/ig/api? This is the base URL which can be extended with the following parameters: The Weather parameter:weather=location Where location can be either a zip code (wea... 阅读全文
posted @ 2010-02-16 17:41 Peter Zhang 阅读(719) 评论(0) 推荐(0)
使用ServiceController控制windows服务
摘要:1.引用System.ServiceProcess命名空间 using System.ServiceProcess;2.声明ServiceController变量private ServiceController _controller;3.假设服务名为ServicesName, 编写开始服务,停止服务,重启服务的代码如下private void StopService(){ this._cont... 阅读全文
posted @ 2010-01-28 11:31 Peter Zhang 阅读(4908) 评论(2) 推荐(1)
系统托盘NotifyIcon控件及右键菜单功能
摘要:(1)新创建一个项目,修改Form1的Text属性为testNotifyIcon; (2)向Form1窗口中添加一个NotifyIcon控件,修改其Name属性为 MyNotifyIcon。修改其Text属性为 testNotifyIcon,与应用程序的标题相同。这是因为NotifyIcon显示在系统托盘中时,Text属性中保存的 文本为鼠标移动到程序图标上时的提示信息。修改Icon属性,为Not... 阅读全文
posted @ 2010-01-28 11:09 Peter Zhang 阅读(7109) 评论(0) 推荐(0)
HttpHandler 读取Session
摘要:继承自IHttpHandler的类要实现两个接口:ProcessRequest和IsReusable但还不能使用Session,要使用Session需要下面的步骤处理:1、先引用System.Web.SessionState 这个命名空间, 2、如果是要在HttpHandler 中读取Session的内容,就要在实现IHttpHandler 的类中同时实现IReadOnlySessionState... 阅读全文
posted @ 2009-12-27 19:17 Peter Zhang 阅读(444) 评论(0) 推荐(0)

1 2 下一页