C#性能优化: 字符串拼接
字符串比较 这个可能很多人知道了,但还是提一下。 string s = “”; 1) if(s == “”){} 2) if(s == string.Empty){} 3) if (string.IsNullOrEmpty(s)) { } 4) if(s != null && s.Length……
C#性能优化: 正则表达式
不要迷信正则表达式 正好在第一个例子里说到了正在表达式(Regex)对象就顺便一起说了。 很多人以为正则表达式很快,非常快,超级的快。 虽然正则表达式是挺快的,不过千万不要迷信他,不信你看下面的例子。 //方法1 public static string ConvertQuot1(string html) { return html.Replac……
C# 性能优化 :减少重复代码
减少重复代码 是最基本的 性能优化 方案,尽可能减少那些重复做的事,让他们只做一次,比较常见是这种代码,同样的Math.Cos(angle) 和Math.Sin(angle)都做了2次。 private Point RotatePt(double angle, Point pt) { Point pRet = new Point(); ……
如何为TreeList单元格自定义Tooltip
How to customize the ToolTip for a TreeList cell Yes, it’s possible. You should drop the ToolTipController onto a form, set the TreeList’s ToolTipController property ……
利用Linq查询List中数据的示例
//1,查询出list中所有女生并且年龄小于18,并按降序排列 //2,查询出list中名字为“王”开头,并且长度为3的学生 using System; using System.Collections.Generic; using System.Linq; public class StudyLinq { public static void Main()……
get attachments info without download entire msg
hi, thanks for the great job of Lumisoft. I run the example of imap client,and find it will be slow when try to view a message with a large attachment,as it download the entire mes……
c#通过 Lumisoft 和 IMAP 协议获取未读邮件数量
POP3协议,SMPT协议,IAMP协议介绍: pop3:(Post Office Protocal 3),3是版本,是目前使用的主流版本。POP3是客户-服务器协议,其中电子邮件的接收需要一个收件服务器,邮件下载到本地计算机上所有一次,从而使离线阅读更轻松,可以指定是否保留副本的邮件在服务器上。 The default port number for PO……