12 2018 档案

Delphi 2010 新增功能之: IOUtils 单元(6): TPath(结构体) 的方法与属性
摘要:以后路径相关的处理, 用 IOUtils.TPath 就很方便了. 阅读全文

posted @ 2018-12-18 17:02 liuweijie

获取各种编码(Unicode,UTF8等)的识别符
摘要:下面是常用编码的识别符, 在 Delphi(2009) 中如何获取呢?Unicode: FF FE; BigEndianUnicode: FE FF; UTF8: EF BB BF 阅读全文

posted @ 2018-12-18 16:57 liuweijie

汉字与区位码(1) - 转换函数
摘要:先上转换函数: 获取区位码表: 准备个 Memo 接收(注意使用了上面的函数) 汉字与区位码(2) - 分析 阅读全文

posted @ 2018-12-18 16:42 liuweijie

汉字与区位码(2) - 分析
摘要:在没有 Uncode 的时代, 用 256 个 ACSII 只是方便了英文, 其他文字怎么办?那时是各自为政的, 譬如中文就有: GB2312-80(国内简体)、Big5(台湾繁体)、HKSCS(香港繁体), 但它们互不兼容.GB2312(1980年) 后来升级到 GBK(1995年), 现在电脑上 阅读全文

posted @ 2018-12-18 16:36 liuweijie

SysErrorMessage 函数和系统错误信息表
摘要:在看 API 文档时, 我们经常见到 GetLastError; 它可以返回操作后系统给的提示.但 GetLastError 返回的只是一个信息代码, 如何返回对应的具体信息呢?FormatMessage 可以, 但这个函数太复杂了; 可以用 SysErrorMessage 代替它. 注:GetLa 阅读全文

posted @ 2018-12-18 16:28 liuweijie

WinAPI 字符及字符串函数(15): CharNext、CharPrev
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2018-12-18 16:06 liuweijie

WinAPI 字符及字符串函数(9): lstrcat - 合并字符串
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2018-12-18 15:50 liuweijie

WinAPI 字符及字符串函数(5): IsCharAlpha - 是否是个字母
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2018-12-18 15:35 liuweijie

关于 Delphi 中流的使用(8) 压缩与解压缩的函数 (封装成函数)
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2018-12-13 09:35 liuweijie

关于 Delphi 中流的使用(7) 压缩与解压缩(TCompressionStream、TDecompressionStream)
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2018-12-13 09:32 liuweijie

Delphi 的内存操作函数(2): 给数组指针分配内存
摘要:静态数组, 在声明时就分配好内存了, 譬如: 对静态数组指针, 虽然在声明之处并没有分配内存, 但这个指针应该分配多少内存是有定数的. 这种情况, 我们应该用 New 和 Dispose 来分配与释放内存. 譬如: 给已知大小的指针分配内存应该用 New, 上面的例子是关于静态数组指针的, 后面要提 阅读全文

posted @ 2018-12-11 15:07 liuweijie

查看内存数据的函数
摘要:重写: 阅读全文

posted @ 2018-12-07 15:02 liuweijie

Delphi 中的 XMLDocument 类详解(10) - 判断节点类型: 支节点、叶节点、文本节点、空节点
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdC 阅读全文

posted @ 2018-12-07 13:58 liuweijie

Delphi 中的 XMLDocument 类详解(9) - 关于 HasChildNodes 与 IsTextElement
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdC 阅读全文

posted @ 2018-12-07 13:50 liuweijie

Delphi中使用TXMLDocument控件应注意的问题 转
摘要:Delphi中使用TXMLDocument控件应注意的问题delphiconstructorxmlclass今天写了一个类,其中用到了TXMLDocument控件。这个控件我是要动态生成的。 但是却遇到了非常奇怪的问题,下面分享一下 procedure TMainForm.Button1Click( 阅读全文

posted @ 2018-12-06 15:25 liuweijie

Delphi中TxmlDocument控件的用法 转
摘要:Delphi中对XML文件的解析做的很好,比直接使用MS的MSXML2_TLB中的接口要方便很多,现称述于下面。 在讲之前先给出一个XML实例,在讲某些部分是要结合实例比较容易理解。 1<?xml version="1.0" encoding="gb2312"?><!--文档版本信息, 注释格式同H 阅读全文

posted @ 2018-12-06 15:24 liuweijie

Delphi NativeXml用法攻略 转
摘要:NativeXml可以在官网上下载,下载后将文件夹放在指定地方,打开DELPHI在其环境变量中引用NativeXml路径,然后在程序中引用NativeXml单元,我们就可以使用NativeXml了。 NativeXml的方法属性: ANativeXml := TNativeXml.Create(Se 阅读全文

posted @ 2018-12-06 15:22 liuweijie

delphi NativeXml的中文支持 乱码
摘要:一般XML的编码格式设置成UTF8比较通用,下面演示使用UTF8编码方式存储和处理包含中文的XML字符串(文件)。1.设置启用内置的widestring支持NativeXml内部使用ANSI string和UTF8编码的string两种字符串类型。如果要让NativeXml能够解析widestrin 阅读全文

posted @ 2018-12-06 15:19 liuweijie

Delphi NativeXML 乱码的问题
摘要:我遇到 NativeXML 在它的一个节点的属性上面写入属性,但是当读出的值中包含汉字的时候出现了乱码。检查代码如下 NativeXml := TNativeXml.Create; try NativeXml.EncodingString := 'GB2312';// 'UTF-8'; Native 阅读全文

posted @ 2018-12-06 15:00 liuweijie

Delphi使用NativeXml访问XML文件
摘要:1.创建XML文件var Doc: TNativeXml;//声明上下文对象var filepath:string;//文件路径DOC:=TNativeXml.CreateName('root');Doc.EncodingString:='gb2312';DOC.XmlFormat:=xfReada 阅读全文

posted @ 2018-12-06 14:57 liuweijie