测试软件的中间健是什么,中间件测试工具

中间件测试工具

object Form3: TForm3

Left = 978

Top = 563

Width = 376

Height = 110

BorderIcons = [biSystemMenu]

Caption = #27979#35797#24037#20855

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Tahoma'

Font.Style = []

OldCreateOrder = False

PixelsPerInch = 96

TextHeight = 13

object Label1: TLabel

Left = 24

Top = 16

Width = 72

Height = 13

Caption = #23458#25143#31471#25968#37327#65306

end

object Label2: TLabel

Left = 24

Top = 48

Width = 48

Height = 13

Caption = #31243#24207#21517#65306

end

object Edit1: TEdit

Left = 112

Top = 13

Width = 65

Height = 21

TabOrder = 0

Text = '1'

end

object Button1: TButton

Left = 183

Top = 11

Width = 75

Height = 25

Caption = #24320#21551

TabOrder = 1

OnClick = Button1Click

end

object Button2: TButton

Left = 272

Top = 11

Width = 75

Height = 25

Caption = #20851#38381#25152#26377

TabOrder = 2

OnClick = Button2Click

end

object Edit2: TEdit

Left = 112

Top = 40

Width = 121

Height = 21

TabOrder = 3

Text = 'd7client.exe'

end

end

unit Unit3;

interface

uses

Windows, Messages, SysUtils, Variants,

Classes, Graphics,

Controls, Forms, Dialogs, StdCtrls, Tlhelp32

;

type

TForm3 = class(TForm)

Label1: TLabel;

Edit1: TEdit;

Button1: TButton;

Button2: TButton;

Edit2: TEdit;

Label2: TLabel;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form3: TForm3;

implementation

{$R *.dfm}

function EndProcess(ExeFileName: string): integer;

const

PROCESS_TERMINATE = $0001;

var

ContinueLoop: BOOLean;

FSnapshotHandle: THandle;

FProcessEntry32: TProcessEntry32;

begin

Result := 0;

FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

FProcessEntry32.dwSize := SizeOf(FProcessEntry32);

ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

while integer(ContinueLoop) <> 0 do

begin

if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile))

= UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile)

= UpperCase(ExeFileName))) then

Result := integer(TerminateProcess(OpenProcess(PROCESS_TERMINATE, BOOL(0),

FProcessEntry32.th32ProcessID), 0));

ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);

end;

CloseHandle(FSnapshotHandle);

end;

procedure TForm3.Button1Click(Sender: TObject);

var

i: integer;

p: PAnsiChar;

begin

p := PAnsiChar(Edit2.Text);

for i := 1 to StrToIntDef(Edit1.Text, 0) do

WinExec(p, SW_NORMAL)

end;

procedure TForm3.Button2Click(Sender: TObject);

begin

EndProcess(Edit2.Text);

end;

end.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值