Delphi常用函数集合-function_more
Delphi常用函数集合-function_more
整理了本人在Delphi编程中常用的函数,函数包分为基础窗体函数(funbasic)、数据库操作函数(fundb)、窗体UI操作函数(funui)
以下为三个函数包的函数目录
fun_basic
//过程 procedure DeleteMe;//自我删除 procedure DeleteIECache;//删除临时文件 procedure DelCookie;//删除cookies procedure fenliduankouint(var sfl:string; var ps,pp:integer);//分离端口数值型 procedure fenliduankoustr(var sfl,ps,pp:string); //分离端口字符串型 procedure getpatch(var slj:string); //得到本机的路径 procedure gettoast(var s:string) ; //对话框提示消息 procedure delfileif(var spach:string);//删除文件先判断后删除 procedure createfolder (var spach:string); //创建文件夹 procedure createfolders (var spach:string); //创建多层文件夹 procedure endprocess(afilename: string); ///结束程序 afilename是进程中的名字,如WinWord.exe procedure openpage_normal (var ssite:string) ; //打开指定的网页 procedure openpage_dhide (var ssite:string); ///隐藏打开IE procedure closeie_all ; //关闭所有的ie procedure closemusci_web ; //webbrowser载入网页的时候屏蔽音乐 procedure separstr_int(var s:string ;var i1,i2,i3,i4,i5:integer); //多,号分离函数返回int procedure separstr_str(var s,s1,s2,s3,s4,s5:string ); //多,号分类函数返回str procedure separstr_two_str(var s,s1,s2:string ); //多,号分类函数2个 procedure separstr_three_str(var s,s1,s2,s3:string ); //多,号分类函数 3个 procedure separstr_three_mao(var s,s1,s2,s3:string ); //多;号分类函数 3个 procedure separstr_four_str(var s,s1,s2,s3,s4:string ); //多,号分类函数 4个 procedure separstr_five_str(var s,s1,s2,s3,s4,s5:string ); //多,号分离5个 procedure separstr_six_str(var s,s1,s2,s3,s4,s5,s6:string ); //多,号分离6个 procedure separstr_seven_str(var s,s1,s2,s3,s4,s5,s6,s7:string ); //多,号分离6个 procedure separstr_nine_str(var s,s1,s2,s3,s4,s5,s6,s7,s8,s9:string ); //多,号分类函数 9个 procedure addlog(var smess:string;var list:Tlistbox);//添加日志 procedure addxls(var sname:string ;var x,y:integer;var str:string); //函数 function GetIP:string;//得到外网IP function ShellDeleteFile(sFileName: string): Boolean; //删除cookies的部分 function GetCookiesFolder:string; //获取本地cookies function getDayofWeek:string; //判断星期几 function getdatetime:string; //得到日期 2009-5-21 17:45:50 function getdate:string; //得到日期 2009-5-21 function gettime:string;//得到日期 得到时间17:45:50 function getyear:string; //得到当前的年份 2009 function rndnumber(i:integer):integer;//产生随机数的函数 产生一个 function rndnumber_rang(x1,x2:integer):integer; //产生随机的范围 function getrandpassword_str(inum:integer):string;//把6传进去就好 字符串 function getrandpassword_int(inum:integer):string; //你把6传进去就好了-数字需要strtoint function getwebpage(var surl:string):string; //打开网页自定义函数 function checkstrisnum(var str:string):boolean; //判断数字的函数 function rangcode(var stext:string; var i:integer):string; //随即产生的验证码 function separrangresult (var srangresult,spostion:string):string; //这是根据指定功能分离随机的内容的函数 3个中产生一个 function PlayWav(var FileName: string): Boolean; function SecondToTime(a:integer):string; function createxls(var sname:string):boolean; //创建一个excell返回布尔量 function StrSubCount(const Source, Sub: string): integer;//统计字符串出现的次数 function GetShellFolders(strDir: string): string; function subcount_cn(var smemo:Tmemo):integer;//返回中文的个数 end; |
fun_db
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | //过程 procedure refreshcombox(var sbiao,szhi:string; Com:TComboBox) ;//统一刷新数据的过程combobox procedure refreshdb(var sbiao:string); //普通刷新数据库内容 procedure refreshdb_desc(var sbiao,sdesc:string); //普通刷新数据库内容降序 procedure refreshdb_item(var sbiao,sitem,sitemstr:string);//根据一个键职去查询数据库 procedure refreshdb_item_desc(var sbiao,sitem,sitemstr,sdesc:string);//根据一个键职去查询数据库 procedure refreshdb_item_two_desc(var sbiao,sdb_item1,sdb_item2,sitem1,sitem2,sdesc:string);//更加两个键值查询数据库倒叙 procedure refreshdb_part(var sbiao,sfield1,sfield2,sfield3,sfield4:string);//刷新指定的数据库字段名 procedure refreshdb_part_item(var sbiao,sfield1,sfield2,sfield3,sfield4:string;var sitem,sitemstr:string);//刷新指定的数据库字段名,并且指定列表 procedure deledbstr(var sbiao,sitem,sitemstr:string); procedure deletable(var sbiao:string); procedure updatestr(var sbiao,ssetitem,ssetitemstr,sitem,sitemstr:string); //更新数据库 procedure getdbstr_two(var sbiao,sitem,sitemstr,sitem_check1,sitem_check2,sitem_return1,sitem_return2:string);//查询字段返回2个值 procedure getdbstr_three(var sbiao,sitem,sitem_str,sitem1,sitem_check1,sitem2,sitem_check2,sitem3,sitem_check3:string); procedure getdbstr_four(var sbiao,sitem,sitem_str,sitem1,sitem_check1,sitem2,sitem_check2,sitem3,sitem_check3,sitem4,sitem_check4:string); ///一次得到4个数据库的值 procedure adddbinfo_seven(var sbiao,sdb1,sdb2,sdb3,sdb4,sdb5,sdb6,sdb7,s1,s2,s3,s4,s5,s6,s7:string); procedure adddbinfo_two_upfile(var sbiao,sitem1,sitem2,sitem_str1,sitem_str2:string); //上传附件的函数 procedure adddbinfo_eight(var sbiao,sdb1,sdb2,sdb3,sdb4,sdb5,sdb6,sdb7,sdb8,s1,s2,s3,s4,s5,s6,s7,s8:string); procedure adddbinfo_nine(var sbiao,sdb1,sdb2,sdb3,sdb4,sdb5,sdb6,sdb7,sdb8,sdb9,s1,s2,s3,s4,s5,s6,s7,s8,s9:string); procedure adddbinfo_ten(var sbiao,sdb1,sdb2,sdb3,sdb4,sdb5,sdb6,sdb7,sdb8,sdb9,sdb10,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10:string); procedure createlocalmdb(var spatch:string);//创建本地的数据库 mdb procedure createlocalcolumn_custom; //创建本地数据库的缓存值 正确答案 procedure truncatetable(sbiao:string);//清空表内容 procedure getlastdb_custom_two(var sbiao,sdb1,sdb2,sdesc,snumlimit:string;var list:TListbox);//查询内容并添加到listbox中 procedure writedbstr(var sbiao,sdb1,sdb2,s1,s2:string);//写入数据2项内容 procedure download_file_db(var sbiao,sdb1,sdb2,spatch,id:string);//从数据库下载文件 procedure releasefromdb(var sbiao,sdb_item1,sdb_item2,sitem1,sitem2:string); //函数 function querydb_bool(var sbiao,sitem,sitemstr:string):boolean;//查询数据内容 是否存在 返回布尔量 function getdbstr(var sbiao,sitem,sitemstr,sitem_check:string):string; function getdbstr_integer(var sbiao,sitem,sitem_check:string;var iitem:integer):string; ////查询字段 返回值 返回string ; function checklogin_boolean(var sbiao,szh,smm:string):boolean; //检查登录的账号密码 function checklogin_two_boolean(var sbiao,sitem_name,sitem_pass,sname,spass:string):boolean; ///判断账号密码是否匹配-全部写入判断的键值 function sqlcount(var sbiao:string):integer;//数据库总数 function testdbcon(var sbiao:string):boolean;//测试数据库连接 function totalunitscount(var sbiao,sdbunit,srecordselect:string):integer; function selecttab_empty_boolean(var irate:integer;var sbiao,svalue:string):boolean; |
fun_ui
1 2 3 4 5 6 | procedure timetoimg(var itime:integer;var img1,img2,img3,img4:TImage); procedure centergroup(var gb:TGroupbox); procedure centerradiogroup(var rgb:TRadiogroup;var tf:TForm); procedure showpic_total(var img1,img2,img3,img4,img5,img6:TImage); procedure showpic_spend(var img1,img2,img3,img4,img5,img6:TImage); function getchangearrow(var i:integer):string;//得到方向上下或者左右的符号,模仿studio的载入效果 -- | |
Comments