摘要: unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;type TForm2 = class(TForm) Timer1: TTimer; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; procedure Timer1Timer(Sender: TObject); private { Private declara 阅读全文
posted @ 2011-02-28 23:51 阳光不远 阅读(1518) 评论(0) 推荐(0) 编辑
摘要: procedure TForm1.Button1Click(Sender: TObject);varszText: array[0..254] of char;hCurrentWindow :hwnd;r:trect ;point:tpoint;begin hCurrentWindow := GetWindow(Handle,GW_HWNDFIRST); memo1.Clear; while hCurrentWindow <> 0 do begin if GetWindowText(hCurrentWindow ,@szText,255) > 0 then if pos(&# 阅读全文
posted @ 2011-02-28 23:51 阳光不远 阅读(1791) 评论(3) 推荐(0) 编辑
摘要: 谁能使得以下代码能够快点,或者用其他方法实现功能,目前2000行数据需要10秒钟左右,如果不加红色部分代码的话需要1秒。unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,RzLstBox,RzChkLst,DB,MemDS,DBAccess,Uni,ComCtrls,RzTreeVw,SQLServerUniProvider;typeTForm1=class(TForm)UniConnection1:TUniConnection;U 阅读全文
posted @ 2011-02-27 15:27 阳光不远 阅读(898) 评论(2) 推荐(0) 编辑
摘要: 最近写了一个小脚本,在公司里有时还是有用的::code@echo offtitle 一键处理打印机因任务不能取消,无法接着打印。 Power BY AK47--DATA:2010-03-31set serverName="Spooler":queryfor /f "skip=3 tokens=4" %%i in ('sc query %serverName%') do set "zt=%%i" &goto :next:nextif /i "%zt%"=="RUNNING" 阅读全文
posted @ 2011-02-27 15:18 阳光不远 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 好久没写技术文了 datasnap传大流。 完整代码,同时感谢叶兄传流的指点,(只公开十天)附:下面代码,转载请注明出处::code服务端:function TServerMethods1.DownLoadFile(AfileName: string): TStream;constSaveFolder = 'FSimage\';defaultName = 'Default.png'; // 此文件必须有//用默认文件处理不存在图片varALLpath: string;beginALLpath := LocalPath + SaveFolder + AfileNa 阅读全文
posted @ 2011-02-27 15:14 阳光不远 阅读(848) 评论(0) 推荐(0) 编辑
摘要: //相关生成代码,VirtualStringTree有点难入门,研究了二天半,终于入门了。PTagCustomListItem = ^TTagCustomListItem;TTagCustomListItem = record Name: string; Id: string;end;varMainFrm: TMainFrm;SysPath: string;List: TStringList;implementation{$R *.dfm}uses fDMfrm;procedure TMainFrm.BuildTree;beginList.Clear;Self.VirtualStringTre 阅读全文
posted @ 2011-02-27 15:12 阳光不远 阅读(1452) 评论(3) 推荐(0) 编辑
摘要: 今天在做拍卖系统的时候,因考虑到网络状况问题,需要将拍品所有信息下载到本机,包括拍品图片,因此需要实现从Internet下载文件的功能。下面是代码片段:1..23private4functionDownloadFile(SourceFile,DestFile:string):Boolean;5procedureURL_OnDownloadProgress(Sender:TDownLoadURL;6Progress,ProgressMax:Cardinal;7StatusCode:TURLDownloadStatus;8StatusText:String;varCancel:Boolean);9 阅读全文
posted @ 2011-02-26 11:26 阳光不远 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 以前不管是做什么软件,只要是关于网页post提交cookie的,我都是用TcpClient,为什么呢?因为我一直找不到idhttp提交Cookie的方法,今天终于有了结果。在Idhttp中,要想修改Cookie的代码,就要用到Request的RawHeaders中的Values值。这个值怎么用呢?Values接受一个string的值,该值指定了所访问的变量。如HTTP头是这样定义的(其中一些):Accept-Language: zh-cnContent-Type: application/x-www-form-urlencodedAccept-Encoding: gzip, deflateUs 阅读全文
posted @ 2011-02-26 11:22 阳光不远 阅读(328) 评论(0) 推荐(0) 编辑
摘要: procedureTForm1.Cut1Click(Sender:TObject);beginSendMessage(ActiveControl.Handle,WM_Cut,0,0);end;procedureTForm1.Copy1Click(Sender:TObject);beginSendMessage(ActiveControl.Handle,WM_Copy,0,0);end;procedureTForm1.Paste1Click(Sender:TObject);beginSendMessage(ActiveControl.Handle,WM_Paste,0,0);end;//如果你开 阅读全文
posted @ 2011-02-26 11:21 阳光不远 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 上家公司有这样的一个需求:在网页中点一个链接,启动我们自己的一个客户端程序,并接受链接传递过来的参数,在客户端做相应的处理1。自定义浏览器协议 只要给注册表写进去一点信息就可以实现将自己定义的协议(如:mylink://)跟某客户端程序关联,google一下就可以了2.只能让这个客户端运行一个实例staticvoidMain(string[]url){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);if(url!=null&&url.Length>0 阅读全文
posted @ 2011-02-26 11:13 阳光不远 阅读(313) 评论(0) 推荐(0) 编辑