DelphiÖÐÎļþ¿½±´·½·¨¼¯ºÏ
Ò»¡¢Ê¹ÓÃÎļþÁ÷µÄ·½·¨½øÐп½±´£¬µ±È»¡£Í¬ÑùµÄµÀÀí£¬ÄãÒ²¿ÉÒÔʹÓÃÄÚ´æÁ÷µÈ·½·¨½øÐÐÎļþµÄ¿½±´£¬ÔÀíÊÇÒ»ÑùµÄ¡£
procedure copyfile(sourcefilename,targetfilename : String);
var f1, f2: tfilestream;
begin
f1 := tfilestream.Create(sourcefilename, fmopenread);
try
f2 := tfilestream.Create(targetfilename, fmopenwrite or fmcreate);
try
f2.Copyfrom(f1, f1.Size);
finally
f2.Free;
end;
finally
f1.Free;
end;
end;
¶þ¡¢Ê¹ÓÃBLOCKREADºÍBLOACKWRITEµÄ·½·¨½øÐÐÎļþµÄ¿½±´¡£
Procedure FileCopy(const fromfile, Tofile: string);
var
F1, F2: file;
NumRead, Numwritten: integer;
Buf: array[1..2048] of char;
begin
AssignFile(F1, fromfile);
reset(F1, 1);
AssignFile(F2, Tofile);
Rewrite(F2, 1);
repeat
BlockRead(F1, Buf, sizeof(Buf), NumRead);
BlockWrite(F2, Buf, NumRead, Numwritten);
until (NumRead = 0) or (Numwritten <> NumRead);
closefile(F1);
closefile(F2);
end;
Èý¡¢Ê¹ÓÃAPIÎļþ½øÐÐÎļþµÄ¸´ÖÆ
procedure CopyFile(fromFileName, ToFileName: string);
var
f1, f2: file;
begin
AssignFile(f1, fromFileName);
AssignFile(f2, ToFileName);
reset(f1);
try
Rewrite(f2);
try
if Lzcopy(TfileRec(f1).handle, TfileRec(f2).handle) < 0
then
raise EinoutError.Create('Îļþ¸´ÖÆ´íÎó');
finally
closefile(f1);
end;
finally
closefile(f2);
end;
end;
ËÄ¡¢Windows APIº¯Êý ʵÏÖÎļþµÄ¿½±´
function CopyFile(lpExistingFileName, lpNewFileName: PChar; bFailIfExists: BOOL): BOOL; stdcall;
²ÎÊý˵Ã÷£º
lpExistingFileName £º ÔÎļþÃû³Æ£»
lpNewFileName £º Ä¿±êÎļþÃû³Æ
bFailIfExists &nbs
Ïà¹ØÎĵµ£º
ÔÚsql server µÄnorthwide Öн¨Á¢Ö÷±í
create table sell_h( sell_id char(10),cust_name char(10) Primary key(sell_id) )
go
create table sell_h( sell_id char(10),inv char(10) ,amt float,qty float Primary key(sell_id,inv) )
Ê×ÏÈ,ҪעÒâÒÔÏÂÉèÖÃ
1.ҪעÒⱨ´Ó±íqrydetailÉèÖÃ,Åú±£´æ¿ªÊ½. ¼´.locktype= batc ......
boolÊÇLongBoolÀàÐÍ¡£
DelphiÖж¨ÒåÁËËÄÖÖ²¼¶ûÀàÐÍ£ºBoolean£¬ByteBool£¬WordBoolºÍLongBool¡£ºóÃæÈýÖÖ²¼¶ûÀàÐÍÊÇΪÁËÓëÆäËûÓïÑÔ¼æÈݶøÒýÈëµÄ£¬Ò»°ãÇé¿öϽ¨ÒéʹÓÃBooleanÀàÐÍ¡£
ÕâËÄÖÖÀàÐ͵IJ¼¶ûÖµÕ¼ÓÃÄÚ´æµÄÊýÁ¿ÈçÏ£º
Boolean 1 Byte
ByteBool 1 Byte
WordBool 2 Bytes£¨1 Word£©
LongBool 4 Bytes£¨2 Words£©
¶Ô ......
ÎÄÕÂÀ´Ô´£ºIT¹¤³ÌÐÅÏ¢Íø http://www.systhinker.com/html/09/n-12309.html
֮ǰÓÃAccess×÷Ò»¸öÓ¦Ó㬵«ÕÒ²»µ½»õ±Òת»»³É´óдÈËÃñ±ÒµÄ¹¦ÄÜ£¨µ±È»¿ÉÒÔͨ¹ýexcel ת»»£¬µ«²»ÔÚÒ»¸öÓ¦ÓÃÉÏ£¬·ÅÆú£©¡£ÒÔΪ±È½Ï¼òµ¥£¬×Ô¼ºÊÔд£¬ËÖªÓÃÁËÁ½¸öÍíÉÏ£¬²Å»ù±¾ÊµÏÖ£¬µ«Ã»ÓÐСÊýµã£¨Ôª£©ÒÔÏ»õ±ÒµÄת»»¡£Ò²Ã»ÓÐÕ×µÄÅжϡ£¶øÇÒ¶Ô×Ö· ......
±Ï¾¹Win32³ÌÐòµÄ¿ª·¢£¬Delphi»¹ÊÇÓÐÍçÇ¿µÄÉúÃüÁ¦µÄ¡£
²Ù×÷²½ÖèÈçÏ£º
1.½¨Á¢ res Îļþ
½¨Á¢Ò»¸öÎı¾Îļþ£¬Ãû×Ö¿ÉÒÔ×Ô¼ºÆð£¬ÎÒÕâÀï½Ð£ºUAC.manifest£¬ÄÚÈÝ£º
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
......
DelphiÖÐʵÏÖÎļþ¿½±´µÄÈýÖÖ·½·¨
1£®µ÷ÓÃAPIº¯Êý
procedure CopyFile(fromFileName,ToFileName:string);
var
f1,f2:file;
Begin
AssignFile(f1,fromFileName); file://Ö¸¶¨Ô´ÎļþÃû
AssignFile(f2,ToFileName); file://Ö¸¶¨Ä¿±êÎļþÃû
Reset(f1);
Try
Rewrite(f2);
Try
If Lzcopy(TfileRec(f1).handle,TfileRe ......