摘要: 推荐使用 Classes.ExtractStrings 函数. function Split(ss,s:string): TStringList; begin Result := TStringList.Create; while Pos(s,ss)>0 do begin Result.Add(Copy(ss,1,Pos(s,ss)-1)); Delete(ss,... 阅读全文
posted @ 2007-11-21 16:35 万一 阅读(5603) 评论(11) 推荐(0) 编辑
摘要: function GetFileSize(const FileName: String): LongInt; var SearchRec: TSearchRec; begin if FindFirst(ExpandFileName(FileName), faAnyFile, SearchRec) = 0 then Result := SearchRec.Size else R... 阅读全文
posted @ 2007-11-21 16:28 万一 阅读(4934) 评论(5) 推荐(0) 编辑
摘要: // ================================================================ // 遍历某个文件夹下某种文件, // 使用说明 //  _GetFileList(ListBox1.Items,'c:\*.doc'); // _GetFileList(MyTStringList,'c:\*.exe'); /... 阅读全文
posted @ 2007-11-21 13:42 万一 阅读(6042) 评论(13) 推荐(1) 编辑
摘要: //工程引用此单元就能防止同时出现多个实例unit MultInst;interfaceuses Windows ,Messages, SysUtils, Classes, Forms;implementationconst STR_UNIQUE = '{2BE6D96E-827F-4BF9-B33E-8740412CDE96}'; MI_ACTIVEAPP = 1; {激活应用程序} MI_... 阅读全文
posted @ 2007-11-21 13:38 万一 阅读(7115) 评论(15) 推荐(1) 编辑
摘要: //隐藏与显示菜单 Self.Menu := nil; {隐藏菜单} Self.Menu := MainMenu1; {显示菜单} 阅读全文
posted @ 2007-11-21 13:08 万一 阅读(6750) 评论(9) 推荐(2) 编辑
摘要: program Project1; {$APPTYPE CONSOLE} var str: string; begin Writeln('请输入:'); Readln(str); Writeln('你输入的是:' + str); Readln; end. 阅读全文
posted @ 2007-11-21 13:05 万一 阅读(6874) 评论(5) 推荐(1) 编辑
摘要: program Project1; uses Windows; begin MessageBox(0,PChar('Ok!'),PChar('Title'),0); end. 阅读全文
posted @ 2007-11-21 13:02 万一 阅读(8441) 评论(7) 推荐(0) 编辑
摘要: program Project1; {$APPTYPE CONSOLE} //uses // SysUtils; {这两行,在本程序中无用,如果带着程序大小是:44.5k; 注释掉程序是19k} begin Writeln('ok'); Readln; end. 阅读全文
posted @ 2007-11-21 13:01 万一 阅读(12091) 评论(10) 推荐(1) 编辑