随笔分类 -  Delphi

上一页 1 2 3 4
Delphi动态创建ClientDataSet的表定义
摘要:前言很多人都在问,ClientDataSet如何才能在不连接数据库得情况下,用程序创建起来,并打开数据集。在研究了一下TClientDataSet数据集后,发现如果要让ClientDataSet打开的话(Open),必须满足三个条件中的一个:ProviderName属性赋值,即有数据源提供者。 Data属性赋值。即从其它已经打开的数据集中获得表结构和数据。 FileName赋值,即从本地文件获取数... 阅读全文
posted @ 2010-09-28 14:09 sunjun0427 阅读(3885) 评论(0) 推荐(0)
用Delphi操作INI文件
摘要:如何操作INI文件? INI 文件在系统配置及应用程序参数保存与设置方面,具有很重要的作用,所以可视化的编程一族,如 VB、VC、VFP、Delphi 等都提供了读写 INI 文件的方法,其中Delphi中操作 INI 文件,最为简洁,这是因为Delphi3提供了一个 TInifile 类,使我们可以非常灵活的处理 INI 文件。一、有必要了解 INI 文件的结构:;注释[小节名]关键字=值...... 阅读全文
posted @ 2010-09-28 11:22 sunjun0427 阅读(357) 评论(0) 推荐(0)
Delphi PChar与String互转
摘要:1.String转化成PChar例:var str: string; pStr:PChar;...pStr := PChar(str);2.PChar转String例:varpStr:PChar; str:string;...str := strPas(pStr); 阅读全文
posted @ 2010-09-28 11:21 sunjun0427 阅读(6538) 评论(0) 推荐(0)
DELPHI listbox去除重复项
摘要:listbox1.Items.IndexOf('重复的字符')= -1 表示没有重复 阅读全文
posted @ 2010-09-28 11:20 sunjun0427 阅读(706) 评论(0) 推荐(0)
Delphi如何把stringgrid中的数据清空
摘要:for i:=1 to stringgrid.rowcount do for j:=1 to stringgrid.colcount do stringgrid.cells[j-1,i-1]:=''; 阅读全文
posted @ 2010-09-28 11:20 sunjun0427 阅读(4940) 评论(0) 推荐(0)
Delphi编程修改ProgressBar的颜色
摘要:delphi编程修改ProgressBar的颜色关键代码如下:usesCommCtrl;procedure TForm1.Button1Click(Sender: TObject);begin// Set the Background color to tealProgressbar1.Brush.Color := clTeal;// Set bar color to yellowSendMess... 阅读全文
posted @ 2010-09-28 11:18 sunjun0427 阅读(2391) 评论(0) 推荐(0)
Delphi 获取本机IP地址
摘要:uses WinSock; function LocalIP: String; type TaPInAddr = Array[0..10] of PInAddr; PaPInAddr = ^TaPInAddr; var phe: PHostEnt; pptr: PaPInAddr; Buffer: Array[0..63] of AnsiChar; i: ... 阅读全文
posted @ 2010-09-28 11:17 sunjun0427 阅读(575) 评论(0) 推荐(0)
Delphi+MySQL:TADOQuery使用插入中文乱码解决方法
摘要:with adoquery dobeginclose;sql.clear;sql.text:=' insert into test (FieldName) values (:FieldName) ';Parameters.ParamByName('FiledName').Value := UTF8Encode('中文(简体/繁體)');ExecSQL;end; 阅读全文
posted @ 2010-09-28 11:16 sunjun0427 阅读(1655) 评论(0) 推荐(0)
Delphi调用外部程序打开文件
摘要:ShellExecute的各种用法一、利用系统默认的邮件收发器发送电子邮件Uses..., ShellAPI;VarlpHwnd: HWND;lpOperation, lpFile, lpParameters, lpDirectory: String;BeginlpHwnd:= GetDesktopWindow();lpOperation:= 'open';lpFile:= 'mailto:' +... 阅读全文
posted @ 2010-09-28 11:03 sunjun0427 阅读(3335) 评论(0) 推荐(0)
Delphi中的操作二进制文件的两个重要函数
摘要:对于通过Byte数组进行文件操作的,在FTP中经常会使用到,我也是在Delphi调用Web Service进行文件的上传和下载时找到这两个函数的,挺好用的,推荐给大家。(申明:非本人所写)1. 将Byte数组生成文件procedure ByteArrayToFile(const ByteArray : TByteDynArray; const FileName : string );varCoun... 阅读全文
posted @ 2010-09-28 10:58 sunjun0427 阅读(2728) 评论(0) 推荐(1)
Delphi中建议使用的语句
摘要:{ No.1 判断逻辑类型 }var B: Boolean;beginB := Boolean(2); //这样只是为了调试//B := True;if B = True then ShowMessage('B = True'); //不建议//不安全///////if B then ShowMessage('B'); //建议//简短end;var B: Boolean;beginif Edit... 阅读全文
posted @ 2010-09-27 09:56 sunjun0427 阅读(517) 评论(0) 推荐(0)

上一页 1 2 3 4