Where is my way?

 

2012年2月1日

Delphi数组索引

摘要: 语法:Property 属性名[索引值]:属性类型 read 方法名 write 方法名TArrayProperty = class private FValues:array[0..1000] of string; procedure SetValue(const index:Integer;const Value:string); function GetValue(const index:Integer):string; public property Values[x:integer]:string read GetValue write Se... 阅读全文

posted @ 2012-02-01 22:40 ManLoveGirls 阅读(645) 评论(0) 推荐(0) 编辑

Delphi属性索引

摘要: 索引说明来使多个属性共用一个访问方法来设置属性的值.属性声明中读、写属性的说明必须是方法,read后面的方法必须附加一个整型的参数,write后的过程方法必须在参数表的倒数第2个参数位置附加一个整形的参数type TProperty = class private FPosition: array[0..2] of Integer; function GetPosition(const Index:Integer):Integer; procedure SetPosition(const Index,Value:Integer); public... 阅读全文

posted @ 2012-02-01 22:32 ManLoveGirls 阅读(1424) 评论(0) 推荐(0) 编辑

2012年1月30日

delphi 一个时钟引发的事情

摘要: 学习c# 事件之后,此前一直云里雾里.后来看到一句话:事件是基于观察者模式,有种扒开云雾见彩虹的感觉.于是趁热打铁重写了以前一个小程序 功能: 定时触发或做某些事 作用:为了方便员工们不需要每天重复统计数据之后再一条一条信息发送到决策人的手机里,于是就做了个定时统计数据并自动发送短信的功能 设计: TClock类, TClockEventArgs类 ,TWorker类 //时,分,秒事件指针 TOnSecondChangeEvent = procedure (sender:TObject;e:TClockEventArgs) of object; TOnMinuteChangeE... 阅读全文

posted @ 2012-01-30 14:51 ManLoveGirls 阅读(890) 评论(0) 推荐(0) 编辑

2011年12月26日

C++数据结构-堆栈实现

摘要: 来源于 [维基百科,自由的百科全书]堆栈(重定向自堆疊)堆栈(英文:stack),在计算机科学中,是一种特殊的串行形式的数据结构,它的特殊之处在于只能允许在链结串行或阵列的一端(称为堆栈顶端指标,英文为top)进行加入资料(push)和输出资料(pop)的运算。另外堆栈也可以用一维数组或链表的形式来完成。由于堆栈数据结构只允许在一端进行操作,因而按照后进先出(LIFO, Last In First Out)的原理运作。堆栈数据结构使用两种基本操作:推入(push)和弹出(pop):推入(push):将数据放入堆栈的顶端(阵列形式或串行形式),堆栈顶端top指标加一。弹出(pop):将顶端数据. 阅读全文

posted @ 2011-12-26 00:42 ManLoveGirls 阅读(7747) 评论(0) 推荐(0) 编辑

2011年10月13日

delhi从数据库导出数据生成Excel并自动发送邮件笔记

摘要: function TMainForm.CreateExcel(Customer:String): OleVariant;var Excel,Sheet,workBook:OleVariant;begin Excel := CreateOleObject('et.Application'); Excel.application.workbooks.add;//newe xls file Excel.Visible := False; // not display Excel.DisplayAlerts := False; Excel.WorkBooks[1].Worksh... 阅读全文

posted @ 2011-10-13 18:43 ManLoveGirls 阅读(866) 评论(0) 推荐(0) 编辑

2011年10月9日

C#集合与接口(二)IEnumerable<T>接口

摘要: //字符中迭代 public class ListBoxTest: IEnumerable<String> { private string[] strings; private int ctr = 0; //可枚举的类可以返回枚举 public IEnumerator<string> GetEnumerator() { foreach (string s in strings) { yield return s;//返回可枚举对象 ... 阅读全文

posted @ 2011-10-09 20:45 ManLoveGirls 阅读(327) 评论(0) 推荐(0) 编辑

C#集合与接口(一)

摘要: 1.集合接口C#提供以下接口ICollection<T> 泛型集合的基接口IEnumerable<T>IEnumerator<T> 实现foreach语句枚举集合ICollection<T> 所有集合都要实现,以提供CopyTo()方法,以及Count、IsSynchronized(线程安全) SyncRoot属性IComparer<T> 比较集合中的两个对象以对集合的排序IComparable<T> IList<T> 肜于数组可索引的集合IDictionary<K,V> 用于基于<键,值&g 阅读全文

posted @ 2011-10-09 20:27 ManLoveGirls 阅读(415) 评论(0) 推荐(0) 编辑

delphi工作笔记利用indy10发送邮件

摘要: //邮件发送typeTEmailState = (esBegin,esSending,esEnd,esFaild);EMailState = TEmailState;TSendEmail= class private FHost:string;//主机 FUserName:String;//用户名 FEmail: TStringList;//收件人邮箱列表 FEmailMsg: string; //邮件正文 FSenderEmail: string;//发送人 FSubject: string;//主题 FiPort: Integer;//端口 ... 阅读全文

posted @ 2011-10-09 20:12 ManLoveGirls 阅读(3366) 评论(1) 推荐(3) 编辑

2011年10月6日

c#学习(一)队列

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace QueueEx{ class Program { static void Main(string[] args) { Queue<int> iQueue = new Queue<int>();//构造一个整型集合队列 for (int i = 0; i < 10; i++) iQueue.Enqueu... 阅读全文

posted @ 2011-10-06 21:11 ManLoveGirls 阅读(322) 评论(0) 推荐(0) 编辑

2011年10月5日

何时使用抽象类或接口

摘要: 假设你设计了一个接口供程序使用,现在想给这个接口增加一个新的成员.这时你面临两个糟糕的选择:一是改变已有的接口,破坏针对原接口编写的已有代码;二是将接口看作是不可改变的.另外创建如IStore2 或IstrageExtended之类的接口。但如果你经常这样做的话,很快就会得到一大批相互紧密关联的接口.而如果采用抽象基类的话只要添加一个virtual方法就可以。结论: 如果要创建一个会被许多人复用的类库最好使用抽象基类;若只是为单个项目创建类,则使用接口更好 阅读全文

posted @ 2011-10-05 11:27 ManLoveGirls 阅读(249) 评论(0) 推荐(0) 编辑

导航