delphi xe5 照相demo
delphi xe5 照相功能,简单的例子
DELPHI xe5 ListView例子
DELPHI xe5 ListView例子,最简单的例子
delphi x5 安卓 地图demo
delphi x5 安卓 地图demo 调用googlewebgis,gis
Planners for VCL
相当好的进度组件;Planners for VCL 进度条 甘特图
Visual+C#+2010入门教程
Visual+C#+2010入门教程,入门到精通哦
ClientDataSet的过滤问题
ClientDataSet的过滤问题
ClientDataSet的使用
ClientDataSet的使用
RICHEDIT复制简单方法
RICHEDIT复制到RICHEDIT,这个我找了老久啊,国外网站的代码
DevExpress 行事历(Scheduler)的常用属性、事件和方法
DevExpress 行事历(Scheduler)的常用属性、事件和方法
webbrowser delphi 事件详解
webbrowser delphi 事件详解
解决delphi关于dbgrid和webbrowser的焦点冲突的问题
解决delphi关于dbgrid和webbrowser的焦点冲突的问题
批量修改数据所有表某类型字段默认
批量修改数据所有表某类型字段默认
使用Mapx在Delphi使用
使用Mapx在Delphi使用
转换OLEVariant和TMemoryStrea
转换OLEVariant和TMemoryStrea
webbrowset操作纪要
webbrowset操作纪要
DataSnap操作SQL
DATASNAP 的资料很少,初学者不错的资料
多用户通讯实例-文件传输
unit MyClass;
interface
uses Classes,SysUtils;
type
{$METHODINFO ON}
TMyClass = class(TComponent)
function Sum(const A, B: Double): Double;
end;
{$METHODINFO OFF}
implementation
uses Unit1;
{ TMyClass }
function TMyClass.Sum(const A, B: Double): Double;
var p:string;
begin
Result := A + B;
p:=floattostr(Result);
TThread.Synchronize(nil,
procedure begin
form1.Memo1.Lines.Add(p);
end);
end;
end.
delphi简单线程演示
delphi简单线程例子,初学者一看就懂
delphi字符串压缩
unit main;
interface
{*********************************************************************
压缩测试单元
作者:崔东伟
Email:cuidongwei@yeah.net 或 s72002004@yahoo.com.cn
发布这一文件的目的是希望它有用,但没有任何担保。甚至没有适合特定目的
而隐含的担保。作者不承担由此带来的任何问题
*********************************************************************}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
const
BufferSize=2048;
type
Tmainfm = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
GroupBox1: TGroupBox;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
GroupBox2: TGroupBox;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
GroupBox3: TGroupBox;
BitBtn7: TBitBtn;
BitBtn8: TBitBtn;
GroupBox4: TGroupBox;
BitBtn10: TBitBtn;
BitBtn11: TBitBtn;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Memo1: TMemo;
Label3: TLabel;
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
mainfm: Tmainfm;
implementation
{$R *.DFM}
uses
lz77,arith,zlib,lh5unit;
procedure ZCompress(InStr, OutStr: TStream);
var
Zstream:TCustomZlibStream;
CompressionLevel:TCompressionLevel;
begin
CompressionLevel:=clMax;
ZStream := TCompressionStream.Create(CompressionLevel, OutStr);
try
ZStream.CopyFrom(InStr, 0);
finally
ZStream.Free;
end;
end;
procedure ZExpand(InStr, OutStr: TStream);
var
Zstream:TCustomZlibStream;
Buffer : Array[0 .. BufferSize - 1] of Byte;
count:integer;
begin
ZStream := TDecompressionStream.Create(InStr);
try
while True do
begin
Count := ZStream.Read(Buffer, BufferSize);
if Count <> 0 then OutStr.WriteBuffer(Buffer, Count) else Break;
end;
finally
ZStream.Free;
end;
end;
procedure Tmainfm.BitBtn3Click(Sender: TObject);
const
cstr:array[1..8] of string=
('lz77Compress',
'lz77Expand',
'ArithCompress',
'ArithExpand',
'LHACompress',
'LHAExpand',
'ZCompress',
'ZExpand');
var
infn,outfn:string;
infile,outfile:TStream;
begin
infn:=Edit1.text;
if not fileexists(infn) then
raise exception.Create('源文件不存在!');
outfn:=Edit2.text;
if fileexists(outfn) then
begin
if application.messagebox('输出文件已经存在,要覆盖该文件吗?',
'警告',MB_ICONQUESTION or MB_YESNO or MB_DEFBUTTON2)=IDNO then exit;
deletefile(outfn);
end;
InFile := TFileStream.Create(infn, fmOpenRead);
try
OutFile := TFileStream.Create(outfn, fmCreate);
try
case TComponent(Sender).tag of
1:lz77Compress(Infile,OutFile);
2:lz77Expand(Infile,OutFile);
3:ArithCompress(Infile,OutFile);
4:ArithExpand(Infile,OutFile);
5:LHACompress(Infile,OutFile);
6:LHAExpand(Infile,OutFile);
7:zCompress(Infile,OutFile);
8:zExpand(Infile,OutFile);
end;
if TComponent(Sender).tag in [1,3,5,7] then
memo1.Lines.add(format('%s 输入%d :bytes 输出:%d bytes 压缩比:%5.2f',
[cstr[TComponent(Sender).tag],InFile.size,outfile.size,outfile.size*100/InFile.size])+'%')
else
memo1.Lines.add(format('%s 输入%d :bytes 输出:%d bytes 压缩比:%5.2f',
[cstr[TComponent(Sender).tag],InFile.size,outfile.size,InFile.size*100/outfile.size])+'%');
finally
outfile.free;
end;
finally
InFile.Free;
end;
end;
procedure Tmainfm.BitBtn1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
edit1.Text:=OpenDialog1.FileName;
end;
procedure Tmainfm.BitBtn2Click(Sender: TObject);
begin
if SaveDialog1.Execute then
edit2.Text:=SaveDialog1.FileName;
end;
end.
delphi http_post
unit Main_U;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls, Buttons, Mask, DBCtrlsEh;
type
TMain_F = class(TForm)
idhtp1: TIdHTTP;
lbl1: TLabel;
lbl2: TLabel;
lbl3: TLabel;
lbl4: TLabel;
edt1: TDBNumberEditEh;
edt2: TDBNumberEditEh;
btn1: TBitBtn;
btn2: TBitBtn;
procedure btn1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Main_F: TMain_F;
implementation
{$R *.dfm}
procedure TMain_F.btn1Click(Sender: TObject);
var
I : Integer;
PostList : TStringList;
begin
btn1.Enabled := False;
btn2.Enabled := True;
PostList := TStringList.Create;
PostList.Values['names'] := 'Name';
PostList.Values['sex'] := '男';
PostList.Values['agey'] := '1983';
PostList.Values['agem'] := '1';
PostList.Values['telb'] := '0755';
PostList.Values['TEL'] := '28121215';
PostList.Values['mb'] := '13838385438';
PostList.Values['area'] := '上海';
PostList.Values['city'] := '上海';
PostList.Values['job'] := '销售';
PostList.Values['EMAIL'] := 'hhh@hhh.com';
PostList.Values['ptitle'] := 'lesson';
PostList.Values['idx'] := '';
PostList.Values['Submit.x'] := '75';
PostList.Values['Submit.y'] := '12';
PostList.Values['Submit'] := '提交即可学习五十音图';
for I := 1 to edt1.Value do
begin
try
idhtp1.Post('http://www.sakurajp.com.cn/free/lesson/login.asp',PostList);
except
end;
Caption := IntToStr(I);
Application.ProcessMessages;
if not btn2.Enabled then
begin
Break;
end;
Sleep(edt2.Value);
end;
PostList.Free;
end;
procedure TMain_F.btn2Click(Sender: TObject);
begin
btn2.Enabled := False;
btn1.Enabled := True;
end;
end.
Googlemap代码
Googlemap代码
unit GEarthMap;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, EarthMap, ComCtrls, ToolWin, XPMan;
type
TFmEarthMap = class(TForm)
stat1: TStatusBar;
Xpmnfst1: TXPManifest;
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure OnShowGPS(Sender: TObject; Longitude, Latitude: Double);
procedure OnMapzoomChange(Sender: TObject; AZoom: Integer);
private
FEmGoogle: TEarthMap;
public
end;
var
FmEarthMap: TFmEarthMap;
implementation
{$R *.dfm}
{ TFmEarthMap }
procedure TFmEarthMap.FormCreate(Sender: TObject);
begin
inherited;
FEmGoogle := TEarthMap.Create(Self);
FEmGoogle.Parent := Self;
FEmGoogle.Align := alClient;
FEmGoogle.OnMapGPS := OnShowGPS;
FEmGoogle.OnMapZoomChange := OnMapzoomChange;
end;
procedure TFmEarthMap.FormDestroy(Sender: TObject);
begin
FEmGoogle.Free;
inherited;
end;
procedure TFmEarthMap.OnMapzoomChange(Sender: TObject; AZoom: Integer);
begin
stat1.Panels[2].Text := '地图放大系数:' + IntToStr(FEmGoogle.MapZoom);
end;
procedure TFmEarthMap.OnShowGPS(Sender: TObject; Longitude, Latitude: Double);
begin
stat1.Panels[0].Text := '经度:' + FloatToStr(Longitude);
stat1.Panels[1].Text := '纬度:' + FloatToStr(Latitude);
end;
end.
Delphi视频控制(Demo+源码).
Delphi视频控制,支持无驱动哦,支持无驱动哦
cxGrid主从表记录
cxGrid主从表记录导出,不错的代码
for i:=0 to cxGrid1DBTableView1.DataController.RowCount-1 do begin
DetailRecCount:=cxGrid1DBTableView1.ViewData.Rows[i].AsMasterDataRow.ActiveDetailGridView.DataController.RecordCount;
memo1.Lines.Append('');
s:='';
for k:=0 to 2 do begin
v:=cxGrid1DBTableView1.ViewData.Rows[i].Values[k];
if VarIsNull(v) then
s:=s+'; '
else
s:=s+string(v)+'; ';
end;
memo1.Lines.Append(s);
for j:=0 to DetailRecCount-1 do begin
s:=' ';
for k:=0 to 3 do begin
if k=1 then continue;
with TcxGridDBTableView(cxGrid1DBTableView1.ViewData.Rows[i].AsMasterDataRow.ActiveDetailGridView) do
v:=ViewData.Rows[j].Values[k];
if VarIsNull(v) then
s:=s+'; '
else
s:=s+string(v)+'; ';
end;
memo1.Lines.Append(s);
end;
memo1.Lines.Append(' 从表共 '+inttostr(DetailRecCount)+' 笔记录.');
end;
PageControl实现的多页面实现
PageControl实现的多页面实现,page哦
DevExpressVCL(全) V5.2
DevExpressVCL大家都懂的,能安装,没话说,强!
ExpressQuantumGrid4.5 中文教程
ExpressQuantumGrid4.5 中文教程 绝对经典
MapInfo基础及应用教程-专题图制作
MapInfo基础及应用教程-专题图制作,详细哦,十多M不是假的
TClientdataset 使用大全
Clientdataset本地数据库操作,MIDAS
DevExpress控件使用说明
DevExpress控件使用说明,dev
Delphi XE2 Data Snap开发实战手册
Delphi XE2 Data Snap开发实战手册,来自台湾的顶级资料,大陆没有发行