哎,服了你了,小妹妹,给你个简单的例子吧.不过你要怎样报答呢?
分数是肯定的了,除了分数还有。。。。。。呵呵,开玩笑的,不要当真。
因为你是不是mm还不清楚呢,就算是又怎么样呢?
program exec;
//这是工程文件
uses
Forms,
main in 'main.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
unit main;
//这是主程序单元,对应窗口form1
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
WinExec( Pchar('C:/Win98/notepad.exe'), SW_SHOW );//具体路径取决于你的windows系统
end;
end.
实现时用缺省的new-》application,然后在窗口上放一个button。
程序运行时当点击按纽时打开记事本