Delphi的总栏位
摘要:unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 =class(TForm)Button1: TButton;Button2: TButton;Button3: TButton;procedure Button1Click(Sender: TObject);procedure Button2Click(Sender: TObject);procedure Button3Click(Sender
阅读全文
摘要:构建一个Json的常用方法:从字符串、从文件、从流unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 =class(TForm)Button1: TButton;Button2: TButton;Button3: TButton;Button4: TButton;procedure Button1Click(Sender: TObject);procedure Button2Click(Send
阅读全文
摘要:一:现在有Json数据{"message":"","data":{"name": "张三", /* 注释 */"age": 33,"sex": true,"weight": 123.456,"tel": ["86-1111111", "86-2222222"],"addresses":{"address":"A省B市"
阅读全文
摘要:JSON(JavaScript Object Notation) 类似与 XML; 虽始于 JavaScript, 但被多种语言支持, 它也成了 Delphi 2009 的新功能之一.DlephiX版本superobject类下载地址:http://code.google.com/p/superobject/downloads/list假如有一段 XML:<id>2</id><name>张三</name><age>99</age>用 json 可以表示为:{"id":2, "name"
阅读全文
摘要:一:新建所需测试单元unit UFunction;interfacetypeTMyfun=class(TObject)publicfunction GetMyAge(Birthday:TDateTime):Integer;end;implementationuses SysUtils,DateUtils;{ TMyfun }function TMyfun.GetMyAge(Birthday: TDateTime): Integer;varsyear,smonth,sday:Word;byear,bmoth,bday:Word;beginsyear:=YearOf(Now);//DecodeDa
阅读全文
|