| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> delphi >> DELPHI de yi xie kai fa ji qiao he fang fa ( er )

DELPHI de yi xie kai fa ji qiao he fang fa ( er )

2007-06-23 04:20:04 编辑來源:互联网 评论
 
 
 
本文为【DELPHI的一些开发技巧和方法(二)】的拼音翻译版
  zuo zhe : toofree
  
  
   biao ti : DELPHI de yi xie kai fa ji qiao he fang fa ( er )
  
  
   guan jian zi : DELPHI kai fa ji qiao
  
  
   fen lei : kai fa ji qiao
  
  
   mi ji : shen sai
  
  
  
  
  
  
   ( ping fen :★ , hui fu : 3, yue du : 1185)
  11、 xiang qi ta ying yong cheng xu fa song mo ni jian :
  var
  h: Thandle;
  begin
  h := FindWindow(nil, ' ying yong cheng xu biao ti ');
  PostMessage(h, WM_KEYDOWN, VK_F9, 0);// fa song F9 jian
  end
  12、 pan duan dang qian wang luo lian jie fang shi :
  ( pan duan jie guo wei MODEM、 ju yu wang huo shi dai li fu wu qi fang shi )
  uses wininet;
  Function ConnectionKind :boolean;
  var flags: dword;
  begin
  Result := InternetGetConnectedState(@flags, 0);
  if Result then
  begin
  if (flags and INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM then
  begin
  showmessage('Modem');
  end;
  if (flags and INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN then
  begin
  showmessage('LAN');
  end;
  if (flags and INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY then
  begin
  showmessage('Proxy');
  end;
  if (flags and INTERNET_CONNECTION_MODEM_BUSY)=INTERNET_CONNECTION_MODEM_BUSY then
  begin
  showmessage('Modem Busy');
  end;
  end;
  end;
  13、 qu ji qi BIOS xin xi :
  with Memo1.Lines do
  begin
  Add('MainBoardBiosName:'+^I+string(Pchar(Ptr($FE061))));
  Add('MainBoardBiosCopyRight:'+^I+string(Pchar(Ptr($FE091))));
  Add('MainBoardBiosDate:'+^I+string(Pchar(Ptr($FFFF5))));
  Add('MainBoardBiosSerialNo:'+^I+string(Pchar(Ptr($FEC71))));
  end;
  14、 jie xi fu wu qi IP di zhi :
  uses winsock
  function IPAddrToName(IPAddr : String): String;
  var
  SockAddrIn: TSockAddrIn;
  HostEnt: PHostEnt;
  WSAData: TWSAData;
  begin
  WSAStartup($101, WSAData);
  SockAddrIn.sin_addr.s_addr:= inet_addr(Pchar(IPAddr));
  HostEnt:= gethostbyaddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET);
  if HostEnt<>nil then result:=StrPas(Hostent^.h_name) else result:='';
  end;
  15、 qing kong yi ge mu lu :
  function EmptyDirectory(TheDirectory :String ; Recursive : Boolean) :
  Boolean;
  var
  SearchRec : TSearchRec;
  Res : Integer;
  begin
  Result := False;
  TheDirectory := NormalDir(TheDirectory);
  Res := FindFirst(TheDirectory + '*.*', faAnyFile, SearchRec);
  try
  while Res = 0 do
  begin
  if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
  begin
  if ((SearchRec.Attr and faDirectory) > 0) and Recursive
  then begin
  EmptyDirectory(TheDirectory + SearchRec.Name, True);
  RemoveDirectory(Pchar(TheDirectory + SearchRec.Name));
  end
  else begin
  DeleteFile(Pchar(TheDirectory + SearchRec.Name))
  end;
  end;
  Res := FindNext(SearchRec);
  end;
  Result := True;
  finally
  FindClose(SearchRec.FindHandle);
  end;
  end;
  16、 ji suan mu lu de da xiao :
  function GetDirectorySize(const Adirectory: string): Integer;
  var
  Dir: TSearchRec;
  Ret: integer;
  Path: string;
  begin
  Result := 0;
  Path := ExtractFilePath(Adirectory);
  Ret := Sysutils.FindFirst(Adirectory, faAnyFile, Dir);
  if Ret <> NO_ERROR then exit;
  try
  while ret=NO_ERROR do
  begin
  inc(Result, Dir.Size);
  if (Dir.Attr in [faDirectory]) and (Dir.Name[1] <> '.') then
  Inc(Result, GetDirectorySize(Path + Dir.Name + '\*.*'));
  Ret := Sysutils.FindNext(Dir);
  end;
  finally
  Sysutils.FindClose(Dir);
  end;
  end;
  17、 huo de ying pan xu lie hao :
  var SerialNum : pdword; a, b : dword; Buffer : array [0..255] of char;
  begin
  if GetVolumeInformation('c:\', Buffer, SizeOf(Buffer), SerialNum, a, b, nil, 0) then Label1.Caption := IntToStr(SerialNum^);
  end;
  18、 mu lu wan quan shan chu :
  procedure Tform1.DeleteDirectory(strDir:String);
  var
  sr: TSearchRec;
  FileAttrs: Integer;
  strfilename:string;
  strPth:string;
  begin
  strpth:=Getcurrentdir();
  FileAttrs := faAnyFile;
  if FindFirst(strpth+'\'+strdir+'\*.*', FileAttrs, sr) = 0 then
  begin
  if (sr.Attr and FileAttrs) = sr.Attr then
  begin
  strfilename:=sr.Name;
  if fileexists(strpth+'\'+strdir+'\'+strfilename) then
  deletefile(strpth+'\'+strdir+'\'+strfilename);
  end;
  while FindNext(sr) = 0 do
  begin
  if (sr.Attr and FileAttrs) = sr.Attr then
  begin
  strfilename:=sr.name;
  if fileexists(strpth+'\'+strdir+'\'+strfilename) then
  deletefile(strpth+'\'+strdir+'\'+strfilename);
  end;
  end;
  FindClose(sr);
  removedir(strpth+'\'+strdir);
  end;
  end;
  19、TFileStream de cao zuo :
  // cong wen jian liu dang qian wei zhi du count zi jie dao huan chong qu BUFFER
  function read(var buffer;count:longint):longint;override;
  // jiang huan chong qu BUFFER du dao wen jian liu zhong
  function write(const buffer;count:longint):longint;override;
  // she zhi wen jian liu dang qian du xie zhi zhen wei OFFSET
  function seek(offset:longint;origin:word):longint;override;
  origin={soFromBeginning,soFromCurrent,soFromEnd}
  // cong ling yi wen jian liu zhong dang qian wei zhi fu zhi COUNT dao dang qian wen jian liu dang qian wei zhi
  function copyfrom(source:Tstream;count:longint):longint;
  // du zhi ding wen jian dao wen jian liu
  var myFStream:TFileStream;
  begin
  myFStream:=TFileStream.create(OpenDialog1.filename,fmOpenRead);
  end;
  20、 huo de CPU xu lie hao :
  function GetCpuId:longint;assembler;register;
  var
  temp:longint;
  begin
  asm
  PUSH EBX
  PUSH EDI
  MOV EDI,EAX
  MOV EAX,1
  DW $A20F
  MOV TEMP,EDX
  POP EDI
  POP EBX
  end;
  result:=temp;
  end;
  procedure TForm1.Button1Click(Sender: Tobject);
  begin
  label1.Caption:=IntToHex(GetCpuId,8);
  end;
  2003-5-30 10:47:00【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
zuo zhe : toofree biao ti : DELPHI de yi xie kai fa ji qiao he fang fa ( er ) guan jian zi : DELPHI kai fa ji qiao fen lei : kai fa ji qiao mi ji : shen sai ( ping fen :★ , hui fu : 3, yue du : 1185) 11、 xiang qi ta ying yong cheng xu fa song mo ni jian : var h: Thandle; begin h := FindWindow(nil, ' ying yong cheng xu biao ti '); PostMessage(h, WM_KEYDOWN, VK_F9, 0);// fa song F9 jian end 12、 pan duan dang qian wang luo lian jie fang shi : ( pan duan jie guo wei MODEM、 ju yu wang huo shi dai li fu wu qi fang shi ) uses wininet; Function ConnectionKind :boolean; var flags: dword; begin Result := InternetGetConnectedState(@flags, 0); if Result then begin if (flags and INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM then begin showmessage('Modem'); end; if (flags and INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN then begin showmessage('LAN'); end; if (flags and INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY then begin showmessage('Proxy'); end; if (flags and INTERNET_CONNECTION_MODEM_BUSY)=INTERNET_CONNECTION_MODEM_BUSY then begin showmessage('Modem Busy'); end; end; end; 13、 qu ji qi BIOS xin xi : with Memo1.Lines do begin Add('MainBoardBiosName:'+^I+string(Pchar(Ptr($FE061)))); Add('MainBoardBiosCopyRight:'+^I+string(Pchar(Ptr($FE091)))); Add('MainBoardBiosDate:'+^I+string(Pchar(Ptr($FFFF5)))); Add('MainBoardBiosSerialNo:'+^I+string(Pchar(Ptr($FEC71)))); end; 14、 jie xi fu wu qi IP di zhi : uses winsock function IPAddrToName(IPAddr : String): String; var SockAddrIn: TSockAddrIn; HostEnt: PHostEnt; WSAData: TWSAData; begin WSAStartup($101, WSAData); SockAddrIn.sin_addr.s_addr:= inet_addr(Pchar(IPAddr)); HostEnt:= gethostbyaddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET); if HostEnt<>nil then result:=StrPas(Hostent^.h_name) else result:=''; end; 15、 qing kong yi ge mu lu : function EmptyDirectory(TheDirectory :String ; Recursive : Boolean) : Boolean; var SearchRec : TSearchRec; Res : Integer; begin Result := False; TheDirectory := NormalDir(TheDirectory); Res := FindFirst(TheDirectory + '*.*', faAnyFile, SearchRec); try while Res = 0 do begin if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then begin if ((SearchRec.Attr and faDirectory) > 0) and Recursive then begin EmptyDirectory(TheDirectory + SearchRec.Name, True); RemoveDirectory(Pchar(TheDirectory + SearchRec.Name)); end else begin DeleteFile(Pchar(TheDirectory + SearchRec.Name)) end; end; Res := FindNext(SearchRec); end; Result := True; finally FindClose(SearchRec.FindHandle); end; end; 16、 ji suan mu lu de da xiao : function GetDirectorySize(const Adirectory: string): Integer; var Dir: TSearchRec; Ret: integer; Path: string; begin Result := 0; Path := ExtractFilePath(Adirectory); Ret := Sysutils.FindFirst(Adirectory, faAnyFile, Dir); if Ret <> NO_ERROR then exit; try while ret=NO_ERROR do begin inc(Result, Dir.Size); if (Dir.Attr in [faDirectory]) and (Dir.Name[1] <> '.') then Inc(Result, GetDirectorySize(Path + Dir.Name + '\*.*')); Ret := Sysutils.FindNext(Dir); end; finally Sysutils.FindClose(Dir); end; end; 17、 huo de ying pan xu lie hao : var SerialNum : pdword; a, b : dword; Buffer : array [0..255] of char; begin if GetVolumeInformation('c:\', Buffer, SizeOf(Buffer), SerialNum, a, b, nil, 0) then Label1.Caption := IntToStr(SerialNum^); end; 18、 mu lu wan quan shan chu : procedure Tform1.DeleteDirectory(strDir:String); var sr: TSearchRec; FileAttrs: Integer; strfilename:string; strPth:string; begin strpth:=Getcurrentdir(); FileAttrs := faAnyFile; if FindFirst(strpth+'\'+strdir+'\*.*', FileAttrs, sr) = 0 then begin if (sr.Attr and FileAttrs) = sr.Attr then begin strfilename:=sr.Name; if fileexists(strpth+'\'+strdir+'\'+strfilename) then deletefile(strpth+'\'+strdir+'\'+strfilename); end; while FindNext(sr) = 0 do begin if (sr.Attr and FileAttrs) = sr.Attr then begin strfilename:=sr.name; if fileexists(strpth+'\'+strdir+'\'+strfilename) then deletefile(strpth+'\'+strdir+'\'+strfilename); end; end; FindClose(sr); removedir(strpth+'\'+strdir); end; end; 19、TFileStream de cao zuo : // cong wen jian liu dang qian wei zhi du count zi jie dao huan chong qu BUFFER function read(var buffer;count:longint):longint;override; // jiang huan chong qu BUFFER du dao wen jian liu zhong function write(const buffer;count:longint):longint;override; // she zhi wen jian liu dang qian du xie zhi zhen wei OFFSET function seek(offset:longint;origin:word):longint;override; origin={soFromBeginning,soFromCurrent,soFromEnd} // cong ling yi wen jian liu zhong dang qian wei zhi fu zhi COUNT dao dang qian wen jian liu dang qian wei zhi function copyfrom(source:Tstream;count:longint):longint; // du zhi ding wen jian dao wen jian liu var myFStream:TFileStream; begin myFStream:=TFileStream.create(OpenDialog1.filename,fmOpenRead); end; 20、 huo de CPU xu lie hao : function GetCpuId:longint;assembler;register; var temp:longint; begin asm PUSH EBX PUSH EDI MOV EDI,EAX MOV EAX,1 DW $A20F MOV TEMP,EDX POP EDI POP EBX end; result:=temp; end; procedure TForm1.Button1Click(Sender: Tobject); begin label1.Caption:=IntToHex(GetCpuId,8); end; 2003-5-30 10:47:00
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚秀气模特裴裴(8)
时尚秀气模特裴裴(7)
时尚秀气模特裴裴(6)
时尚秀气模特裴裴(5)
白墙黑瓦
广州东郊[原创]
八美至丹巴的东谷天然盆景
不一样的
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有