上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 203 下一页
摘要: procedure TFrmAnnouncement.SetStoragerText;var strStoragerText, strKeyWord: string; tmpList: TStringList; LenText, I, j, K: Integer; curRow: TPoint; t 阅读全文
posted @ 2013-04-26 16:58 delphi中间件 阅读(2084) 评论(0) 推荐(0)
摘要: unit MD5; interface usesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls; typeMD5Count = array [0 .. 1] of 阅读全文
posted @ 2013-04-03 16:13 delphi中间件 阅读(807) 评论(0) 推荐(0)
摘要: 如果客户端是TCP/IP是短连接的情况就没有必要了。type pClientConns = ^TClientConns; // 客户连接 TClientConns = record clientid: integer; ip: string; port: string; logintime: TDateTime; end;type G_ClientConnects: TDictionary<TIdTCPConnection, pClientConns>; // 客户端连接字典procedure TServerContainer1.DSTCPServerT... 阅读全文
posted @ 2013-03-07 09:47 delphi中间件 阅读(3712) 评论(1) 推荐(0)
摘要: procedure TForm1.Button1Click(Sender: TObject);begin Memo1.Clear; Memo1.Lines.Add('char---' + IntToStr(SizeOf(char))); Memo1.Lines.Add('ansichar---' + IntToStr(SizeOf(ansichar))); Memo1.Lines.Add('byte---' + IntToStr(SizeOf(byte))); Memo1.Lines.Add('word---' + IntToSt 阅读全文
posted @ 2013-03-06 11:35 delphi中间件 阅读(707) 评论(0) 推荐(0)
摘要: 测试代码文件:--------------------------------------------------------------------------------unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Memo1: TMemo; Memo2: TMemo; Button1: TButton; Button2: TButton; Butt 阅读全文
posted @ 2013-03-03 11:38 delphi中间件 阅读(2013) 评论(0) 推荐(0)
摘要: 如用 TArray<Word> 代替 array of Word, 还可以使用 TArray 类提供的算法(就是少了点).--------------------------------------------------------------------------------uses Generics.Collections, Generics.Defaults;{测试 TArray 的 Sort 方法}procedure TForm1.Button1Click(Sender: TObject);var arr: TArray<string>; //同 array 阅读全文
posted @ 2013-03-03 11:35 delphi中间件 阅读(805) 评论(0) 推荐(0)
摘要: system.zlib单元 封装了zlib 1.2.5system.zip单元内主要就是 TZipFile 类, 最方便使用的是它的类方法:--------------------------------------------------------------------------------TZipFile.ExtractZipFile() //解压 Zip 文件到指定文件夹TZipFile.IsValid() //判断指定文件是否是有效的 Zip 文件TZipFile.ZipDirectoryContents() //压缩指定路径下的所有文件 阅读全文
posted @ 2013-03-03 11:33 delphi中间件 阅读(720) 评论(0) 推荐(0)
摘要: procedure MyMethod;var i: Integer;begin for i := 0 to 500000 do begin Form1.Canvas.Lock; Form1.Canvas.TextOut(10, 10, IntToStr(i)); Form1.Canvas.Unlock; end;end;procedure TForm1.Button1Click(Sender: TObject);begin TThread.CreateAnonymousThread(MyMethod).Start; end;1、TThread 现在增加了许多 class 方法(直接通过类名调用 阅读全文
posted @ 2013-03-03 11:32 delphi中间件 阅读(1159) 评论(0) 推荐(0)
摘要: 以后路径相关的处理, 用 IOUtils.TPath 就很方便了.//较常用的方法:TPath.GetTempPath; {获取临时文件夹路径}TPath.GetTempFileName; {获取一个临时文件名}TPath.GetPathRoot(); {提取盘符, 如: c:\}TPath.GetDirectoryName(); {提取路径}TPath.GetFileName(); {提取文件名}TPath.GetExtension(); {提取扩展名}TPath.GetFileNameWithoutExtension(); {提取无扩展名的文件名}TPath.ChangeExtension 阅读全文
posted @ 2013-03-03 11:31 delphi中间件 阅读(2577) 评论(0) 推荐(0)
摘要: IOUtils 单元主要就是三个结构: TDirectory、TPath、TFile, 很有用; 下面是 TFile 的功能简介.--------------------------------------------------------------------------------TFile.Exists();--------------------------------------------------------------------------------//判断指定的文件是否存在----------------------------------------------- 阅读全文
posted @ 2013-03-03 11:30 delphi中间件 阅读(2554) 评论(1) 推荐(0)
上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 203 下一页