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

delphi±£´æ¶ÁÈ¡utf 8µÄÎı¾Îļþ

delphi±£´æ¶ÁÈ¡utf-8µÄÎı¾Îļþ
¸ø¿Í»§×öÁËÒ»¸öÅúÁ¿Ê¶±ðͼÏñ²¢ºÏ³ÉË«²ãpdfµÄ³ÌÐò£¬×îºó¿Í»§ÐèÒªÉú³ÉµÄͬʱ¸½´øÒ»·Ý¼Çʱ¾Îļþ£¬¾ÍÊÇOCR¹ýºóµÄÎı¾£¬²¢Ö¸¶¨utf-8¸ñʽµÄ¡£ÔÚ´¦Àíutf-8ʱ³öÏÖÁ˵ãСÎÊÌ⣬ÏÖÔÚ×ܽáÈçÏÂ
Ê×ÏÈ ÀûÓÃdelphi×Ô´øµÄUTF8Encodeº¯Êý£¬½«ÆÕͨ×Ö·ûת»»Îªutf-8±àÂë
´´½¨Ò»¸öÁ÷£¬MemoryStream»òFileStream¶¼¿É
º¯Êý¿´ÆðÀ´ÈçÏÂ
ÒýÓÃ
procedure SaveUTF8File(AContent:WideString;AFileName: string);
var
  ffileStream:TFileStream;
  futf8Bytes: string;
  S: string;
begin
  ffileStream:=TFileStream.Create(AFileName,fmCreate);
  futf8Bytes:= UTF8Encode(AContent);
  ffileStream.Write(futf8Bytes[1],Length(futf8Bytes));
  ffileStream.Free;
end;
ÔËÐкó²é¿´Éú³ÉµÄÎļþ£¬È«ÊÇÂÒÂ룬ÉÏÍøËÑË÷·¢ÏÖ
unicodeÎı¾Îļþ£ºÍ·Á½¸ö×Ö·û·Ö±ðÊÇFF   FE£¨16½øÖÆ£©
utf-8Îı¾Îļþ£ºÍ·Á½¸ö×Ö·û·Ö±ðÊÇEF   BB£¨16½øÖÆ£©
Ô­À´ÊÇÍüÁ˰ÑÎļþÍ·¼Ó½øÈ¥ÁË
ÓÚÊǼÓÈë´úÂëºó
ÒýÓÃ
procedure SaveUTF8File(AContent:WideString;AFileName: string);
var
  ffileStream:TFileStream;
  futf8Bytes: string;
  S: string;
begin
  ffileStream:=TFileStream.Create(AFileName,fmCreate);
  futf8Bytes:= UTF8Encode(AContent);
  S:=#$EF#$BB#$BF;
  ffileStream.Write(S[1],Length(S));
  ffileStream.Write(futf8Bytes[1],Length(futf8Bytes));
  ffileStream.Free;
end;
±£´æÎļþºó²é¿´£¬»¹ÊÇÂÒÂë¡£ÕÒÁ˰ëÌìÎÊÌâ×îºóÖÕÓÚ·¢ÏÖÎÊÌâ³öÏÖÔÚÉùÃ÷µÄ²ÎÊýWideStringÉÏ£¬¸Ä³Éstring¾ÍûÎÊÌâÁË¡£
×îºóÉú³É µÄ´úÂëÈçÏÂ
ÒýÓÃ
procedure SaveUTF8File(AContent:string;AFileName: string);
var
  ffileStream:TFileStream;
  futf8Bytes: string;
  S: string;
begin
  ffileStream:=TFileStream.Create(AFileName,fmCreate);
  futf8Bytes:= UTF8Encode(AContent);
  S:=#$EF#$BB#$BF;
  ffileStream.Write(S[1],Length(S));
  ffileStream.Write(futf8Bytes[1],Length(futf8Bytes));
  ffileStream.Free;
end;
ÔÙ¸½ÉÏÒ»¶Î¶ÁÈ¡utf-8Îı¾µÄ´úÂë
ÒýÓÃ
function  LoadUTF8File(AFileName: strin


Ïà¹ØÎĵµ£º

DelphiµÄOFFICE¿ª·¢[ת]

1£®ÒýÑÔ
ÔÚÀûÓÃdelphi¿ª·¢Ó¦ÓóÌÐòµÄʱºò£¬Í¨³£ÎÒÃÇÒªÉè¼Æ³öºÜ¶à¸÷ÖÖ¸ñʽµÄÎĵµ¡¢±¨±í£¬¾­³£Òª½øÐÐÎļþµÄ´´½¨¡¢±à¼­¼°Ð޸ģ¬ËäÈ»delphi±¾ÉíÌṩÁ˺ܶàÉè¼Æ±¨±íµÄ¿Ø¼þ»ò·½·¨£¬µ«ÊÇ´æÔÚÃ÷ÏԵIJ»×㣬±ÈÈçÖÐÎÄÊäÈ룬Êý¾Ý¸ñʽµÄ¿ØÖƵȲÙ×÷ÆðÀ´±È½ÏÂé·³¡£ÀûÓôó¼Ò¶¼ºÜÊìϤµÄoffice¹¤¾ß½áºÏ¿ª·¢£¬Äܹ»ºÜºÃµÄ½â¾öÕâ·½ÃæµÄÎÊÌâ¡£ÒÔÏ ......

delphi TStringListµÄÓ÷¨

delphi TStringListµÄÓ÷¨
TStringsÊÇÒ»¸ö³éÏóÀ࣬ÔÚʵ¼Ê¿ª·¢ÖУ¬ÊdzýÁË»ù±¾ÀàÐÍÍ⣬ӦÓõÃ×î¶àµÄ¡£
³£¹æµÄÓ÷¨´ó¼Ò¶¼ÖªµÀ£¬ÏÖÔÚÀ´ÌÖÂÛËüµÄһЩ¸ß¼¶µÄÓ÷¨¡£
ÏȰÑÒªÌÖÂ۵öÊôÐÔÁгöÀ´£º
1¡¢CommaText
2¡¢Delimiter & DelimitedText
3¡¢Names & Values & ValuefromIndex
ÏÈ¿´µÚÒ»¸ö£ºCommaText¡£Ôõô ......

delphiÖÐCreateMutex£¬OpenMutexʹÓÃÒ»Àý

VCÉùÃ÷
HANDLE CreateMutex(
¡¡¡¡LPSECURITY_ATTRIBUTES lpMutexAttributes, // SD
¡¡¡¡BOOL bInitialOwner, // initial owner
¡¡¡¡LPCTSTR lpName // object name
¡¡¡¡);
delphiÉùÃ÷£º
function CreateMutex(lpMutexAttributes: PSecurityAttributes; bInitialOwner: BOOL; lpName: PChar): THandle; stdcall;
´´½ ......

Delphi µÄ Dll º¯ÊýµÄ µ÷ÓÃ


Ò»¡¢Dll½¨Á¢
£¨Ò»£©DLLÏîÄ¿µÄ½¨Á¢
library mydll;
 
uses
base in 'base.pas';
 
exports
Triple name 'Tr';
 
{$R *.res}
 
begin
end.
 
£¨¶þ£©º¯Êýµ¥Ôª
unit base;
 
interface
 
uses windows;
 
function Triple(N:integer):integer;stdcall;
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ