易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi实现操作Excel示例

implementation
uses ComOBJ;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var ExcelAPP1:Variant;
    ExcelApp2:Variant;
    I,j: Integer;
    ID,IDX:string;
begin
try
  ExcelAPP1:=CreateOleObject('Excel.Application');
  ExcelAPP1.Workbooks.Open('D:\Program Files\Embarcadero\Projects\操作Excel\奖.xls');
  ExcelAPP2:=CreateOleObject('Excel.Application');
  ExcelApp2.Workbooks.Open('D:\Program Files\Embarcadero\Projects\操作Excel\贫2.xls');
  for I := 2 to 610 do 
  begin
    Label1.Caption:=IntToStr(i)+'行';
    ID:=trim(ExcelAPP1.cells[I,2].value);
    for j := 4 to 549 do   
    begin
      IDX:=trim(ExcelAPP2.cells[j,4].value);
      if (IDX=ID) then
      begin
        ExcelAPP1.cells[i,12].value:='已建档';
        Break;
      end;
    end;
  end;
  Label1.Caption:='全部完成,正在保存......';
  ExcelAPP1.Save;   
  Label1.Caption:='全部完成,已保存';
finally
  ExcelAPP1.WorkBooks.Close;
  ExcelAPP1.Quit;
  ExcelApp2.WorkBooks.Close;
  ExcelAPP2.Quit;
end;
end;


相关文档:

用 delphi 打开网页

uses ShellAPI;
procedure TForm1.Button1Click(Sender: TObject);
begin
//用IE打开
  ShellExecute(Handle, 'open', 'IExplore.EXE', 'about:blank', nil, SW_SHOWNORMAL);
//用火狐打开
  ShellExecute(Handle, 'open', 'firefox.exe', 'about:blank', nil, SW_SHOWNORMAL);
//用默认浏览器打开
&nbs ......

delphi 取CPU序列号的方法


interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TDemoForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GetButton: TBitBtn;
CloseButton: TBitBtn;
Bevel1: TBevel;
Label5: TLabel; ......

delphi随机输入验证码

输入验证码 一个文本框 24字母随机出4个字母 然后用户
输入所随机出的字母 输入正确 进入界面。。错误又随机下。。。
*/
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
lbl1: TLabel;
Edit1: TEdit; ......

Delphi简单U盘传染病毒

program Project1;
{$APPTYPE CONSOLE}
uses
   windows, Tlhelp32,   SysUtils;
//===========================获得系统目录=======================================
function GetWinDir: string;
var
   Buf: array[0..MAX_PATH] of char;
begin
   GetSystemDirector ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号