摘要: (19)A selection of tips招数19:精选技巧集合Including height and width in tags will allow your page to render more quickly, because space can be allocated for the image before it is downloaded.在标签中包括height和width属性会加速你的页面呈现,因为下载完成之前空间可以分配给图像。(20)Add script references at the bottom of the page, because asynchr. 阅读全文
posted @ 2013-07-19 16:24 安布雷拉 阅读(221) 评论(0) 推荐(0) 编辑
摘要: (18)When in production, carefully consider what you need to log招数18:在生产环境,仔细考虑你需要记录哪些日志Many people deploy to production without checking how logging is currently configured. It is always advisable to check whether your policy is to have logging on or off by default and, if on, what level you should 阅读全文
posted @ 2013-07-18 14:14 安布雷拉 阅读(331) 评论(0) 推荐(0) 编辑
摘要: (17)Avoid running sites in debug mode招数17:避免在调试模式下运行网站When it comes to ASP.NET, one of the most common performance blunders I see on a regular basis is accidentally or intentionally running sites in debug mode. Language-level optimizations, such as using StringBuilders, Arrays instead of Lists, Swit 阅读全文
posted @ 2013-07-17 14:07 安布雷拉 阅读(279) 评论(0) 推荐(0) 编辑
摘要: (16)Reduce the data sent across the network招数16:减少通过网络发送的数据Reducing the amount of data sent across the network can improve application performance significantly. Compressing CSS and JavaScript is possible using bundling and minification. This will reduce the number of server requests and the amount 阅读全文
posted @ 2013-07-16 14:20 安布雷拉 阅读(189) 评论(0) 推荐(0) 编辑
摘要: (15)Reduce memory leaks dramatically with the “using” statement招数15:显式的使用using语句减少内存泄露If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.如果一个类实现了IDisposable接口,使用using语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。 阅读全文
posted @ 2013-07-15 13:31 安布雷拉 阅读(308) 评论(0) 推荐(0) 编辑
摘要: (14)Review what client scripts you are using招数14:检查你使用了什么客户端脚本Out of the box, many ASP.NET projects include client script libraries which you may or may not beusing. It’s always a good idea to check what you are using, and when.拿来即用,很多ASP.NET项目包括你可能会或可能不会用的客户端脚本库。检查你正在使用什么,并在需要时候使用它总是一个好的方法。 阅读全文
posted @ 2013-07-11 14:13 安布雷拉 阅读(178) 评论(0) 推荐(0) 编辑
摘要: (13)Always perform validation on the server as well招数13:总是在服务器端执行验证This isn’t exactly a performance tip but rather a security tip for when people think that they could improve performance by cutting out server-side validation. These days, client-side validation can be bypassed with ease, so you can’ 阅读全文
posted @ 2013-07-10 13:25 安布雷拉 阅读(261) 评论(0) 推荐(0) 编辑
摘要: (12)For a snappy user experience, always validate on the client招数12:为了生动的用户体验,总是在客户端验证To avoid unnecessary round trips to the server, validate form entries on the client using JavaScript before posting them. This provides quick feedback and makes your application feel more responsive. Always make su 阅读全文
posted @ 2013-07-09 14:08 安布雷拉 阅读(247) 评论(0) 推荐(0) 编辑
摘要: (11)Make sure paging is conducted at the database layer招数11:确保分页是在数据层完成的When using grid UI controls (framework based, or 3rd party owned), you should carefully consider how paging is implemented. Many controls implement paging in a simplistic fashion, where the database is required to return all ava 阅读全文
posted @ 2013-07-08 14:13 安布雷拉 阅读(236) 评论(0) 推荐(0) 编辑
摘要: (4)A selection of tips招数4:精选的技巧Make sure HTTP compression is turned on for any uncompressed content. HTML in particular compresses significantly, and in this era of mobile friendliness and slow 3G connections, that’s essential.确保为未压缩的内容打开HTTP压缩。在这个面向移动友好和3G连接缓慢的时代,HTML压缩尤其明显,这是至关重要的。(5)Always set th 阅读全文
posted @ 2013-07-05 15:05 安布雷拉 阅读(216) 评论(0) 推荐(0) 编辑
摘要: (3)Use Microsoft’s PDBs to debug or profile external assemblies or libraries招数3:使用Microsoft的PDBs调试和分析外部的程序集和库To accurately debug or profile an external assembly or library (i.e. one you’re not directly compiling), you need the PDB files that accompany each of the DLLs.These files give your debugger 阅读全文
posted @ 2013-07-04 14:27 安布雷拉 阅读(254) 评论(0) 推荐(0) 编辑
摘要: (2)Remove unused View Engines招数2:移除不用的视图引擎If you're an ASP.NET MVC developer, you might not know that ASP.NET still loads the View Engines for both Razor and Web Forms by default. This can cause performance issues because MVC will normally look for Web Forms views first, before switching over to 阅读全文
posted @ 2013-07-03 14:06 安布雷拉 阅读(398) 评论(0) 推荐(0) 编辑
摘要: (1)Caching is a last resort招数1:缓存是最后的手段Projects that use multiple levels of cache often demonstrate a misunderstanding of why caching is required in the first place.项目中使用多重缓存经常会表现会产生误会,为什么缓存是第一步必须的。Caching is not synonymous with performance. Your code should already be efficient. Caching should only 阅读全文
posted @ 2013-07-03 14:05 安布雷拉 阅读(496) 评论(0) 推荐(0) 编辑
摘要: DataTable.Select()调用Select.SelectRows()调用Select.GetRows()返回DataRow[]Select对象访问级别为internal测试代码: DataTable dt = new DataTable(); dt.Columns.Add("Source"); DataRow dr = dt.NewRow(); dr["Source"] = "hao123mphhn'b'b'bb'bb' 'b"; dt.Rows.Add(dr); ... 阅读全文
posted @ 2013-06-09 11:04 安布雷拉 阅读(3131) 评论(0) 推荐(0) 编辑
摘要: JQuery.each 遍历一个集合的时候,有时候我们不需要完全遍历,在找出需要的数据的时候,想跳出 JQuery.each 这个时候,问题出现了。常规思维方式: <form id="form1" runat="server"> <div> <p>1</p> <p>2</p> <p>3</p> <p>4</p> <p>5</p> <p>6</p> <p>7</p> 阅读全文
posted @ 2012-05-24 10:52 安布雷拉 阅读(10474) 评论(8) 推荐(1) 编辑
摘要: 在一次项目评审会议中自由答疑环节,被有关专家问及如果保证网站安全的时候,感觉回答的不是很有调理,所以在博客来整理一下。服务器安全网站安全 服务器安全:容灾备份(加装 RAID 卡)、软硬件防火墙(端口的监听)、SqlService设置(端口设置)、SqlService 代理(数据库定时备份),FTP(端口设置)、同步软件(同步网站数据),Windows 计划任务。 网站安全:Sql 防注入,前台(Web)和管理(Web)的分离,后台(Web)登陆页面(验证码),用户管理(防止使用弱口令)。 阅读全文
posted @ 2012-05-23 09:41 安布雷拉 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 今天在做一个功能的时候,需要把 Request.ServerVariables 属性绑定给 Repeater 控件显示,Request.ServerVariables返回的是一个 NameValueCollection对象,一个键值对的集合。谷歌了一下,居然无一例外需要在 Repaeter_ItemDataBound 事件进行相应的处理,类似于下面的代码:前台页面: <asp:Repeater ID="Repeater1" runat="server" onitemdatabound="Repeater1_ItemDataB... 阅读全文
posted @ 2012-05-11 14:48 安布雷拉 阅读(1105) 评论(0) 推荐(0) 编辑
摘要: 引言:项目工期的控制,应该是开发人员,项目经理,产品经理最为之关心,也最头疼的问题。关于工期的控制,我有几点思考:项目可行性分析。怎样制定目标,怎样完成验收。工期的时间粒度划分。追求细节对于工期的影响。领导过程干预,束手缚脚。团队技术氛围的营造。具体实施: 在需求阶段,应该对项目的可行性进行分析。结合团队的技术实力,客观的分析。制定每个阶段,可量化的需求标准。需求不确定或者根本就是不行的项目,工期控制是无从谈起的。 在实施阶段,对于每个阶段的目标,应该确定需求是明确,可以量化标准。验收时,严格按照本阶段制定需求进行验收,避免想当然或者验收本不属于本阶段的内容。 对于验收结果进行评估,... 阅读全文
posted @ 2012-05-07 15:19 安布雷拉 阅读(2032) 评论(4) 推荐(0) 编辑
摘要: “复合格式化”为我们格式化字符串提供了便利,但是使用的时候还是有需要我们注意的几点:可以忽略占位符允许交换占位索引同一个占位符允许出现多次每个占位符必须对应一个参数,否则会引发FormatException 异常未定义的占位符,同样会引发 FormatException 异常测试代码:using System;namespace SystemExample{ class Program { static void Main(string[] args) { // Call Sample Fun Essentia... 阅读全文
posted @ 2012-05-03 14:25 安布雷拉 阅读(817) 评论(0) 推荐(0) 编辑
摘要: 先来看看传统的,我们需要判断一个表示是否为空,进行条件赋值的做法:1 // 三元运算符,判断表达式是否为空,进行条件赋值2 exp2 = (exp1 !=null) ? exp1 : "not null value"; 是否觉得有写着有点繁琐,现在看看 c#2.0 时代提供的“双问号” 这个二元运算符号:1 // C# 2.0 提供的新语法,实现功能和上例相同2 exp2 = exp1 ??"not null value"; 是不是觉得写起来特轻松惬意呢? 阅读全文
posted @ 2011-07-18 16:07 安布雷拉 阅读(6554) 评论(0) 推荐(0) 编辑
摘要: 也不知是什么时候,开始厌恶也冗长的“自解释”变量,更愿意用简单的变量命名法。举个例子:获取上传文件的扩展名:string postedFileExt = Path.GetExtension(posted.FileName).TrimStart(new char[] { '.' });这里的postedFileExt,就是自解释的变量命名方法。让我们看另一个完整的例子:string postedFileExt = Path.GetExtension(posted.FileName).TrimStart(new char[] { '.' });string vali 阅读全文
posted @ 2011-07-13 10:06 安布雷拉 阅读(372) 评论(1) 推荐(0) 编辑
摘要: 印度精英全球化在世界知名的公司里,做到最高层的中国人(包括入了其他国籍的华人),类似杨致远、李开复、王嘉廉等并不是很多,而百事可乐的CEO、思科的CTO、Adobe的CEO、花期的CEO、LSI的CEO、沃达丰的CEO、摩托罗拉的联合CEO等等都是印度裔。论智力和勤奋程度,中国人要高于印度人,但要说混得好,还数印度人。印度CEO们有别于其他国家卓越企业领导人的关键因素:执着地专注于成长和创新、高度利他主义的经商哲学、高度的坚韧力和诚信度、更为正式和职业化的人际关系取向日本的戴明奖戴明奖关注的是质量、效率、成本、企业文化、统计思维和方法、质量小组、持续改善、自动化。戴明奖的实质是质量会带来利润, 阅读全文
posted @ 2011-06-23 22:55 安布雷拉 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Web Standard and ASP.NET – Part1 XHTML Quick StartDflying | 26 March, 2006 18:47Web Standard is more and more important in current web based application development. In these series of posts I am going to sharing some of my ideas about how to build Web Standard applications using ASP.NET 2.0.This po 阅读全文
posted @ 2011-06-23 14:17 安布雷拉 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 构思中… 阅读全文
posted @ 2011-06-18 12:18 安布雷拉 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 前言:FileUpload 服务器控件用多了,自己写html控件通过表单上传文件出现了不少问题,当你调试时,发现HttpFileCollection为空时,请检查下面几点:代码: <form method="post" action="../handler/FileUpload.ashx" enctype="multipart/form-data"> <input id="file-uploader" name="file-uploader" type="file&q 阅读全文
posted @ 2011-05-16 14:59 安布雷拉 阅读(456) 评论(0) 推荐(1) 编辑
摘要: Although frame is generally not recommended on most of the web pages, iFrame can still be useful in some occasions, especially as an Ajax alternative. One strength of Ajax is that it greatly reduces (... 阅读全文
posted @ 2011-05-16 14:28 安布雷拉 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 尽管大多数的互联网用户都在使用包括 IE、火狐和 Chrome 等主流浏览器,但互联网就是这么百花齐放,一些在某方面有特长的浏览器可能会受某些用户青睐,例如经常访问社交网络的会需要社交版浏览器之类的。下面为你推荐10款非主流的浏览器,部分是开源的:K – Meleon : K-Meleon是一个网页浏览器,基于Gecko.其Gecko排版引擎来自Mozilla基金会的编写,且也用在Mozilla Firefox、Mozilla Suite和SeaMonkey中.Maxthon : Maxthon (相信很多人对此浏览器很熟悉)是一个强大的多页面浏览器(非开源软件). 除了方便的浏览功能, 傲游 阅读全文
posted @ 2011-05-14 14:47 安布雷拉 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 引言:今天看了博客园一位博友“菜菜灰”写的博文:《关于软件多版本升级的一些思考》,有感而发,虽然是做Web应用,在线升级版本的功能还是很必要。上午花费了2个小时写了一个“模拟软件在线升级的类”,希望对博友“菜菜灰”有点帮助。软件类: /// <summary> /// 软件类 /// </summary> public class Soft { private string v = "1.0"; private IList<string> vl = new List<string>() { "1.0", & 阅读全文
posted @ 2011-05-13 10:55 安布雷拉 阅读(1757) 评论(2) 推荐(1) 编辑
摘要: 4.8.1.0 1: workbook.Save(System.IO.Path.GetFileName(path), FileFormatType.Default, SaveType.OpenInEx... 阅读全文
posted @ 2011-05-12 17:06 安布雷拉 阅读(6981) 评论(0) 推荐(0) 编辑
摘要: 引用:using System.Web.Script.Serialization;代码:var resp = new { flag = false, url = ConfigReader.LogoutPage};JavaScriptSerializer serializer = new JavaScriptSerializer();context.Response.Write(serializer.Serialize(resp));总结:JavaScriptSerializer 可以让我们轻松序列化一个匿名对象,方便前台通过Ajax异步方式获取Json对象,进行处理,省去后台拼接字... 阅读全文
posted @ 2011-05-12 16:21 安布雷拉 阅读(2522) 评论(0) 推荐(0) 编辑
摘要: 今天我由一篇博文引入我每周一讲的题目,这篇文章的题目:游戏开发行业那些事 -- 2.红海变死海看了这篇文章后,很受启发,笔者作为一个在游戏行业打拼了10年的开发者,发表了自己的看法和预见:引用一:“诸多其他小公司的快速开发、山寨、同质化、短视逐利、换皮,基本没有活路。”引用二:“一次又一次愚弄玩家, 只会被玩家抛弃。过不了多久,MMO网游就会面临洗牌。 这就是我说的“红海”变"死海"。”看到这里的时候,明显体会到笔者笔下对当今国产网游行业的一丝悲情的表露,回过头来思考一下,当前公司的传统行业业务:“网站开发”业务是不是也是也是深陷“红海的泥沼”呢?混乱的市场,低价的恶劣竞争 阅读全文
posted @ 2011-05-07 08:27 安布雷拉 阅读(276) 评论(0) 推荐(0) 编辑
摘要: <iframe allowtransparency="true" /> 阅读全文
posted @ 2011-04-21 15:48 安布雷拉 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 引言:在函数调用的时候,我们往往希望函数能够“聪明”一点,能够明白调用者的心思,看下面的例子。示例一(默认实现) /// <summary> /// 获取日志集合 /// </summary> /// <param name="where">筛选条件</param> /// <param name="orderBy">排序条件</param> /// <returns></returns> public DataTable GetLogs(WhereClip 阅读全文
posted @ 2011-04-20 15:49 安布雷拉 阅读(1744) 评论(11) 推荐(2) 编辑
摘要: 1. 代码中时常出现条件语句分支,这样的代码很不利于扩展。例如下面代码片段: if (context.Request["action"] != null) { string action = context.Request["action"]; switch (action) { case "a": ActionA(); break; case "b": ... 阅读全文
posted @ 2011-04-18 10:07 安布雷拉 阅读(2986) 评论(42) 推荐(3) 编辑
摘要: 原始的设计:///<summary> /// 修改密码 ///</summary> ///<param name="id">主键</param> ///<param name="oldPassword">原密码</param> ///<param name="newPassword">新密码</param> ///<returns></returns>publicbool ChangePassword(int id, 阅读全文
posted @ 2011-04-04 10:39 安布雷拉 阅读(862) 评论(2) 推荐(1) 编辑
摘要: 常规泛型操作,保存一个实体类,定义的方法如下:int DbSession.Save<T>(T entity)现在有一个需求,就是在保存实体entity后,获取数据库的自增主键?原始的Save方法不能提供这样的功能,和群里的朋友讨论了一会(这里特别感谢下群里的朋友 终ゝ)是从他那里获取的灵感,算是把这个问题给解决了。解决方案如下:public bool AddEntity(T entity, out int pkValue){ bool isOk = false; isOk = DbSession.Save<T>(entity) > 0; if (isOk) { p 阅读全文
posted @ 2011-03-17 13:55 安布雷拉 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 前言:公司接了一个代理商下订单的系统,决定采用外包的方式消化掉这个项目,于是我自荐做了这个外包项目的负责人,下面就记录一下这过程遇到的问题。1. 外包给谁,没有稳定的外包供求对象?2. 外包项目的质量怎么控制,过程怎么监督?工期怎么控制,项目后期的维护工作怎么做?3. 需求分析怎么做?做到什么层次?4. 用户界面,数据库设计这些谁来做,系统框架谁来完成?结合上面的问题,自己给自己提了个醒,外包项目绝对不比自己一个人单干来的容易。更多的时候,自己是站在一个项目经理的角度去审视问题。下面我就罗列一下,我的应对之道吧。-,-1. 对于外包的对象,我选择一个熟悉朋友,因为大家都是做.NET开发,平时没 阅读全文
posted @ 2011-03-14 00:02 安布雷拉 阅读(2668) 评论(4) 推荐(1) 编辑
摘要: I'm using Log4NET for almost a year now, and I must say I'm very pleased with it. This logging framework is very easy to learn and extend; same goes for installation and configuration.The most commonly used log4net appender is probably the ADONetAppender (look at Ryan'spost for an easy w 阅读全文
posted @ 2011-01-16 21:15 安布雷拉 阅读(475) 评论(0) 推荐(0) 编辑
摘要: I’ve been asked this question a few times in the last couple of months, so I thought I would put together an example page to show how you can get Flash content to stretch to 100 percent height and width without using tables.It’s actually pretty simple. Here’s some of the CSS I used:代码Code highlighti 阅读全文
posted @ 2010-12-10 09:27 安布雷拉 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 禁用ViewState后,WebForm还有意义吗?WebForm 是基于事件的开发模式,禁用ViewState 后,破坏了控件事件的完整性,那我们还会在Web.config里面禁用掉ViewState吗?这么做什么意义,会不会破坏我们WebForm的开发模式。下面是禁用掉ViewState 后,控件事件对应的情况。Repeater操作:ItemCommand(失效)数据:DataBinding(可用)行为:ItemCreated(可用) , ItemDataBound(可用)Button操作:Click (可用), Command(待验证)数据:DataBinding(可用)DropDown 阅读全文
posted @ 2010-12-03 13:36 安布雷拉 阅读(6199) 评论(52) 推荐(5) 编辑