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

Delphi³£ÓôúÂë»ã×Ü

¡ó[DELPHI]²úÉúÊó±êÍ϶¯Ð§¹û
ͨ¹ýMouseMoveʼþ¡¢DragOverʼþ¡¢EndDragʼþʵÏÖ£¬ÀýÈçÔÚPANELÉϵÄLABEL£º
var xpanel,ypanel,xlabel,ylabel:integer;
PANELµÄMouseMoveʼþ£ºxpanel:=x;ypanel:=y;
PANELµÄDragOverʼþ£ºxpanel:=x;ypanel:=y;
LABELµÄMouseMoveʼþ£ºxlabel:=x;ylabel:=y;
LABELµÄEndDragʼþ£ºlabel.left:=xpanel-xlabel;label.top:=ypanel-ylabel;
¡ó[DELPHI]È¡µÃWINDOWSĿ¼
uses shellapi;
getwindowsdirectory(windir,sizeof(windir));
»òÕß´Ó×¢²á±íÖжÁÈ¡£¬Î»Öãº
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
SystemRoot¼ü£¬È¡µÃÈ磺C:\WINDOWS
trunc()
¡ó[DELPHI]¹ØÓÚÎļþ¡¢Ä¿Â¼²Ù×÷
Chdir('c:\abcdir');תµ½Ä¿Â¼
Mkdir('dirname');½¨Á¢Ä¿Â¼
Rmdir('dirname');ɾ³ýĿ¼
GetCurrentDir;//È¡µ±Ç°Ä¿Â¼Ãû£¬ÎÞ'\'
Getdir(0,s);//È¡¹¤×÷Ŀ¼Ãûs:='c:\abcdir';
Deletfile('abc.txt');//ɾ³ýÎļþ
Renamefile('old.txt','new.txt');//Îļþ¸üÃû
ExtractFilename(filelistbox1.filename);//È¡ÎļþÃû
ExtractFileExt(filelistbox1.filename);//È¡Îļþºó׺
¡ó[DELPHI]´¦ÀíÎļþÊôÐÔ
attr:=filegetattr(filelistbox1.filename);
if (attr and faReadonly)=faReadonly then ... //Ö»¶Á
if (attr and faSysfile)=faSysfile then ... //ϵͳ
if (attr and faArchive)=faArchive then ... //´æµµ
if (attr and faHidden)=faHidden then ... //Òþ²Ø
¡ó[DELPHI]Ö´ÐгÌÐòÍâÎļþ
WINEXEC//µ÷ÓÿÉÖ´ÐÐÎļþ
winexec('command.com /c copy *.* c:\',SW_Normal);
winexec('start abc.txt');
ShellExecute»òShellExecuteEx//Æô¶¯Îļþ¹ØÁª³ÌÐò
function executefile(const filename,params,defaultDir:string;showCmd:integer):THandle;
ExecuteFile('C:\abc\a.txt','x.abc','c:\abc\',0);
ExecuteFile('http://tingweb.yeah.net','','',0);
ExecuteFile('mailto:tingweb@wx88.net','','',0);
¡ó[DELPHI]È¡µÃϵͳÔËÐеĽø³ÌÃû
var hCurrentWindow:HWnd;szText:array[0..254] of char;
begin
hCurrentWindow:=Getwindow(handle,GW_HWndFrist);
while hCurrentWindow <> 0 do
begin
if Getwindowtext(hcurrnetwindow,@sztext,255)>0 then listbox1.items.add(strpas(@sztext));
hCurrentWindow:=Getwindow(hCurrentwindow,GW_HWndNext);
end;
end;
¡ó[DELPHI]¹ØÓÚ»ã±àµÄǶÈë
A


Ïà¹ØÎĵµ£º

delphiÖкó׺Ãû·Ö±ðÖ¸´úµÄÎļþºÍÓô¦

dpr Ϊ¹¤³ÌÎļþ
dfm Ϊ´°ÌåÎļþ
pas Ϊµ¥ÔªÎļþ
cfg ÅäÖÃÎļþ
dof ΪÏîĿѡÏîÎļþ(Ò»°ãûÓÃ)
dcu compiled   unitsÎļþ ,±àÒëºóµÄµ¥ÔªÎļþ
res ×ÊÔ´Îļþ
ddp Îļþ¾ÍÊÇDelphi   Diagram   Portfolio¼òд,ÊÇÓÃÀ´±£´æCode   EditorÖеÄDiagramÐÅÏ¢µÄ.
Ò»°ãÒ»¸öÏîĿҪ¿¼¸ö±ðÈ ......

Delphi Òþ²Ø´°¿Ú±íµ¥

   
  ÎÒÒ»¿ªÊ¼ÒÔΪ£¬½«±íµ¥ÉèÖÃΪÒþ²Ø£¬¿ÉÒÔÔÚ±íµ¥´´½¨Ê¼þÖм´FormCreate(Sender:TObject)È¥ÉèÖÃ
  Òò´Ë£¬ ÎÒÔÚÕâ¸öprocedure TForm.FormCreate(Sender:TObject)ÖУ¬
   ÏëÓÃÒ»ÏÂÁ½ÖÖ·½Ê½ÊµÏÖ
   ¼´£º
   µ÷Óà     from.Hi ......

DelphiÖÐÓÃADOÁ¬½ÓÊý¾Ý¿â

´ËÎÄÊʺÏDelphiÐÂÊÖÔĶÁ£¬ÌرðÊÇÁ¬½ÓÊý¾Ý¿â·½Ã滹һ¶®°ë¶®ÉõÖÁ¸ù±¾²»¶®µÄÐÂÊÖ£»
     --------------------------µ«×ÜÌåÏÔµÃÓеãÂÒ-------------------------
     ±¾ÎÄÕÂÒÔDelphi 7ºÍSQL Server 2000ΪÀý£¬¿Ø¼þÃû¾ùΪϵͳĬÈÏ£¬ÈçUnit1,DataModule1,Edit1,ADOCommand1,ADODataS ......

ʹÓÃDelphiÄÚÖú¯Êý¶ÁдINIÎļþ


ÀûÓÃWindows APIº¯ÊýWritePrivateProfileString ºÍGetPrivateProfileString¿É¶Ô.INIÎļþ½øÐжÁд²Ù×÷¡£Æäʵ£¬¶Ô.INIÎļþµÄ¶ÁдÍêÈ«¿ÉÒÔÀûÓÃDelphiµÄÄÚÖú¯ÊýÀ´ÊµÏÖ¡£ÏÂÃæ¾Í½éÉÜһЩ¶Ô.INIÎļþ¶ÁдʱÏà¹ØµÄÀ༰ÆäÊôÐÔ·½·¨¡£
1¡¢TIniFile¶ÔÏó
ÒÔDelphiÖУ¬¶¨ÒåÁËÒ»¸öTIniFile¶ÔÏ󣬽«.INIÎļþ·â×°ÔÚÆäÖУ¬²¢ÌṩһЩ·½·¨£ ......

Delphi µÄ×Ö·û¼°×Ö·û´®[

Delphi µÄ×Ö·û¼°×Ö·û´®[1] - string¡¢AnsiString¡¢WideString¡¢String[n]¡¢ShortString
2008-10-17 14:57:17
//×î³£ÓÃµÄ string
var
  str: string;   {¶¨Òå}
begin
  str := 'ÍòÒ»'; {¸³Öµ}
  ShowMessage(IntToStr(Length(str))); {³¤¶ÈÊÇ: 4}
end;
//³¤×Ö·û´® AnsiString; ÔÚµ±Ç°°æ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ