Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DelphiÎļþ²Ù×÷

 unit unitFileOP;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
implementation
function GetSys32Dir:String;
var
Sys32Dir: string;
pSys32Dir: array[0..Max_Path] of char;
begin
GetSystemDirectory(pSys32Dir,Max_Path);
Sys32Dir := String(pSys32Dir) + chr(92);
Result := Sys32Dir;
end;
procedure MyFileCopy(const fromFile, ToFile: string);
var
fromF, ToF: file;
NumRead, NumWritten: integer;
Buf: array[1..2048] of Char;
begin
AssignFile(fromF, fromFile);
Reset(fromF, 1);
AssignFile(ToF, ToFile);
Rewrite(ToF, 1);
repeat
BlockRead(fromF, Buf, SizeOf(Buf), NumRead);
BlockWrite(ToF, Buf, NumRead, NumWritten);
until (NumRead = 0) or (NumWritten <> NumRead);
CloseFile(fromF);
CloseFile(ToF);
end;
function GetExeFileVersion(fn: string; var ma, mi, r, b: integer): boolean;
var
buf, p: pChar;
sver: ^VS_FIXEDFILEINFO;
i: LongWord;
begin
i := GetFileVersionInfoSize(pchar(fn), i);
new(sver);
p := pchar(sver);
GetMem(buf, i);
ZeroMemory(buf, i);
result := false;
if GetFileVersionInfo(pchar(fn), 0, 4096, pointer(buf)) then
if VerQueryValue(buf, '\', pointer(sver), i) then
begin
ma := sVer^.dwFileVersionMS shr 16;
mi := sver^.dwFileVersionMS and $0000FFFF;
r := sver^.dwFileVersionLS shr 16;
b := sver^.dwFileVersionLS and $0000FFFF;
result := true;
end;
Dispose(p);
FreeMem(buf);
end;
function GetVersionString(const pFileName: string): string;
var
VerInfoSize: DWORD;
VerInfo: Pointer;
VerValueSize: DWORD;
Dummy: DWORD;
VerValue: PVSFixedFileInfo;
begin
Result := '0';
VerInfoSize := GetFileVersionInfoSize(PChar(pFileName), Dummy);
if VerInfoSize = 0 then
Exit;
GetMem(VerInfo, VerInfoSize);
GetFileVersionInfo(PChar(pFileName), 0, VerInfoSize, VerInfo);
VerQueryValue(VerInfo, chr(92), Pointer(VerValue), VerValueSize);


Ïà¹ØÎĵµ£º

ÖÕÓڸ㶨ÁËDelphiµÄUnicodeÖ§³Ö(Tnt¿Ø¼þ)

Ô­À´ÊÇÒªÔÚFormCreateÖмÓÈëÒÔÏ´úÂë:
procedure TTntForm1.TntFormCreate(Sender: TObject);
begin
  //Õâ¾äºÜ¹Ø¼ü.¶ÔÓÚÆ½Ì¨µÄÖ§³Ö.
  if Win32Platform = VER_PLATFORM_WIN32_NT then
    Font.Name := 'MS Shell Dlg 2'
  else
    Font.Name := 'MS Shell Dlg';
......

Using COM+ object pooling with Delphi 6

 URL: http://edn.embarcadero.com/article/27568
Abstract: Delphi 6 introduces support for COM+ object pooling, which can provide significant performance improvements under some circumstances. We take a look at Delphi 6s object pooling support. By Vincent Parrett.
Typically, when a client appl ......

Format¸ñʽ Delphi

Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËÆºõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·­Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬Á ......

delphiÆô¶¯·þÎñÍ£Ö¹·þÎñн¨·þÎñµÄ·½·¨

 
unit Servicescontrol;
   
interface  
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
   
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName:  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ