05 2011 档案

摘要:How to store records to stream and retrieve them later------------------------------------------------------{ Stores a record to stream. Record can later be retrieved with RecordFromStream procedure } Procedure RecordToStream(DSet : tdataSet;{ Datset in question } Stream : TStream; { Stream to store 阅读全文
posted @ 2011-05-10 21:27 九月的海 阅读(213) 评论(0) 推荐(0)
摘要:public sealed class Singleton{ Singleton() { } public static Singleton Instance { get { return Nested.instance; } } class Nested { static Nested() { } internal static readonly Singleton instance = new Singleton(); }}这是C#单例模式中“延迟初始化”的代码,延迟初始化就是在用到的时候才加载对象实例化,这里也可以声明为静态对象,比如:public sealed class Single 阅读全文
posted @ 2011-05-07 16:27 九月的海 阅读(216) 评论(0) 推荐(0)
摘要:function ComPressFile(dstFile,srcFile:string):Boolean;var vclzip:TVCLZip;begin Result:=False; vclzip:=TVCLZip.create(nil); try with vclzip do begin try ZipName:=dstFile; RecreateDirs:=true; //注意这里 StorePaths:=False; FilesList.Add(srcFile); Recurse := True; Zip; Result:=True; except Application.Messa 阅读全文
posted @ 2011-05-03 10:05 九月的海 阅读(700) 评论(0) 推荐(0)