07 2012 档案
摘要:{ 1 h=1*60 m=1*60*60 s=1*60*60*1000 hs=3600000hs}{时间 计时器 00:01:14}//label1.Caption:= StartCount();function StartCount():string;{$j+}consth:Integer=0;m:Integer=0;s:integer=0;{$j-}begininc(s);if s>=60 thenbeginInc(m);s:=0;end;if m>=60 thenbeginInc(h);m:=0;end;Result:=Format('%.2d:%.2d:%.2d&#
阅读全文
摘要:{获得磁盘驱动器序列号} function Get_HD_Serial(const Drivedir: Char): string; var Nu: DWORD; Vf: DWORD; VolumeInfo: array[0..MAX_PATH] of Char; V_n: DWORD; begin
阅读全文
摘要:{得到系统C:\Windows\system32 路径}//调用Edit1.text:=getSys32Path();function getSys32Path():string;varsPath : PCHAR ;beginGetMem(sPath,255);GetSystemDirectory(sPath,255);Result := sPath;//C:\Windows\system32end;通过 为知笔记 发布
阅读全文
摘要:{GetDriveType} //调用GetDriveTypeA(Memo1); procedureGetDriveTypeA(Memo:TMemo); var i:Integer; C:String; DType:Integer; DriveString:String; begin //通过循环依次判断各盘符的类型 Memo.Clear; fori:=65to90do begin C:=chr(i)+':\'; DType:=GetDriveType(PChar(C)); caseDTypeof 0:DriveString:=C+'不能判断的驱动器类型.';
阅读全文
摘要:{获取本机当前用户名}//调用 返回值:= GetUser();function GetUserName(): string;varBuffer: array[0..255] of Char;Size: cardinal;beginSize := 256;if GetUserName(Buffer, Size) thenbeginResult := BufferendelsebeginResult := 'Unknown'end;end;{获取计算机名}//调用 返回值:= GetComputerName();function GetComputerName(): string
阅读全文
摘要:usesShellAPI;{打开网址}//调用Link('www.baidu.com'); procedureLink(URL:string); begin ShellExecute(Application.Handle,nil,PChar(URL),0,0,SW_SHOWNORMAL); end; 通过 为知笔记 发布
阅读全文
摘要:{取得汉字的第一个字母} //调用 edit1.text:=GetPYIndexChar('你')functionGetPYIndexChar(str:string):char; begin caseWORD(str[1])shl8+WORD(str[2])of $B0A1..$B0C4:result:='A'; $B0C5..$B2C0:result:='B'; $B2C1..$B4ED:result:='C'; $B4EE..$B6E9:result:='D'; $B6EA..$B7A1:result:=
阅读全文
摘要://在uses下面引用function SHEmptyRecycleBinA(Wnd:HWND;str:PChar;WRD:DWORD):Integer;stdcall; external 'SHell32.dll';{清空回收站}//调用EmptyRecycle();functionEmptyRecycle():boolean; begin Result:=true; try ifApplication.MessageBox('确定要清空回收站吗?','提示',MB_YESNO)=ID_YESthen SHEmptyRecycleBinA(Ap
阅读全文
摘要://============================================================================== {*******************************************************} {} {清空IE记录} {} {版权所有(C)2012testStudio} {} {最后修改2012年7月23日13:4...
阅读全文
摘要:{删除文件到回收站} //iffileexists('d:\a.txt')thenRecycleFile('d:\a.txt'+#0); //usesshellapi; functionRecycleFile(sFileName:string):Boolean; var FOS:TSHFileOpStruct; begin FillChar(FOS,SizeOf(FOS),0); withFOSd...
阅读全文
摘要:{让窗体全屏显示} //SetFormFullScreen(Form1); procedureSetFormFullScreen(Form:TForm); begin Form.BorderStyle:=bsNone; Form.WindowState:=wsMaximized; Form.Color:=clBlack; end; 通过 为知笔记 发布
阅读全文
摘要:{不重复添加Edit1.text到列表框中} //调用ListBoxAddItems(Edit1,ListBox1); procedureListBoxAddItems(Edit:TEdit;ListBox:TListBox); begin ifListBox.Items.IndexOf(Edit.Text)<0then begin ListBox.Items.Add(Edit.Text); Edit.SetFocus; end; end; 通过 为知笔记 发布
阅读全文
摘要:{对listbox中的整型数据重小到大排序并返回最小值} //调用sortListBox(ListBox1); //listbox的项目必须能转换成整型的数值functionsortListBox(ListBox:TListBox):integer; var I,J:Integer; temp:string; beginifListBox.Items.Count=0thenExit;withLis...
阅读全文
摘要:{使Edit控件中只能输入数字和1个小数点} //调用放在Edit的KeyPress事件下setOnePoint(Key,Edit1); procedureSetEditOnePoint(varKey:Char;CTRL:Tedit); varp:integer;tp:TPoint; begin ifkeyin['0'..'9','+','-','.']then begin ifkeyin['+'...
阅读全文
摘要:usesIniFiles;//引用IniFiles {$R*.dfm} {写入信息到ini文件} //WriteEdit('Config.ini','Options','Edit',Edit1); procedureWriteEdit(fileName:string;section:string;Ident:string;Edit:TEdit); varINIFILE:TIniFile; begi...
阅读全文
摘要:uses IniFiles;//引用IniFiles{写入信息到ini文件} //WriteformState('Config.ini','MainForm',Form1) procedureWriteformState(fileName:string;section:string;form:TForm); varINIFILE:TIniFile; begin INIFILE:=TIniFile....
阅读全文
摘要:uses IniFiles; {写入Memo中的项目到ini中} //调用WriteMemoItems('settings.ini','MEMO',Memo1); procedureWriteMemoItems(constAINIFile,ASection:string;MEMO:TMemo); var INI:TINIFile; iniPath:string;//ini路径 I:Integer;...
阅读全文
摘要:usesIniFiles; {写入列表框中的项目到ini中} //调用WriteListBoxItems('settings.ini','Listbox',ListBox1); procedureWriteListBoxItems(constAINIFile,ASection:string;ListBox:TListBox); var INI:TINIFile; iniPath:string;//...
阅读全文
摘要:usesRegistry; {ReadStrFormRegRegistry} //调用ReadStrFormReg('TEST',Edit1); procedureWriteStrToReg(SectionStr:string;Edit:TEdit); var Reg:TRegistry; keyName:string; begin Reg:=TRegistry.Create; Reg.RootK...
阅读全文
摘要:{shutdown -s -t 0 立即关闭计算机shutdown -l 立即注销计算机shutdown -r -t 0 立即重启计算机shutdown -a 取消关闭计算机}{在uses中引入 ShellAPI} uses ShellAPI;{关机相关}//调用//Shutdown(0);procedure Shutdown(sType:integer);begincasesType of0: ShellExecute(Application.Handle, 'open', 'shutdown.exe', '-s -t 0', 0, SW_SH
阅读全文
摘要://------------------------------------------function Enc(Str:String):String;{加密} function Dec(Str:String):String;{解密} //------------------------------------------{字符加密} //调用Edit1.Text:=Enc(Edit1.Text);//加密 functionEnc(Str:String):String; constXorKey:array[0..7]ofByte=($B2,$09,$AA,$55,$93,$6D,$84,$47
阅读全文
摘要:{得到文件的大小 KB}//调用返回值:=GetFileSize(application.ExeName);functionGetFileSize(constFileName:string):string; var SR:TSearchRec; begin Result:='-1'; ifFindFirst(FileName,faAnyFileand(notfaDirectory),SR)=0th...
阅读全文
摘要:{删除自己} //DeleteMe; //close; procedureDeleteMe(); var bf:TextFile; bf1:string; pf:TProcessInformation; sf:TStartupInfo; begin bf1:=ExtractFilePath(ParamStr(0))+'_deleteme.bat'; AssignFile(bf,bf1); Rewr...
阅读全文
摘要:C++Builder建立及调用DLL第1章 C++Builder6概述11.1 初识C++Builder6的可视化开发环境11.2C++Builder6快速入门41.2.1C++Builder6的第一个示例——“欢迎进入奇妙的C++Builder世界!”41.2.2 C++Builder的工程概述81.3面向对象编程的基本概念91.3.1面向对象的程序设计91.3.2类、对象、属性、方法91.3....
阅读全文
摘要:共享软件注册机产生注册码{1 硬盘序列号2 CPU 序列号3 显卡号4 机器码}验证注册码{1 对比 动态的 2 网络注册 if (注册码=特征码){//通过}else{//注册码错误 }}功能限制{1 软件使用的次数2 软件使用的天数3 某些功能的限制功能4 计点的}通过 为知笔记 发布
阅读全文
摘要:注册用户名______ 密码______ qq号______通过 为知笔记 发布附件列表
阅读全文
摘要:void__fastcallTForm1::Button1Click(TObject*Sender) { try { inti=Edit1->Text.ToInt(); Edit1->Text=AnsiString(10/i); } catch(...) { ShowMessage("Error"); } } 通过 为知笔记 发布
阅读全文
摘要://---------------------------------------------------------------------------//挂上、卸下Keyboardhook,并运用自定义信息传递Hook数据//---------------------------------------------------------------------------#include<v...
阅读全文
摘要:void __fastcall Tf7_2_1::FormCreate(TObject *Sender){ hsbR->Position=0; hsbG->Position=0; hsbB->Position=0; lblRGB->Color=RGB(0,0,0);}//----------------------------------------------------------------...
阅读全文
摘要:通过 为知笔记 发布
阅读全文