请教控件OpenDialog控件的使用
请问OpenDialog是否可以打开一个目录窗体且找到需要的文件后并可以记录该文件的路径及文件名。
就比如我们在安装硬件驱动程序在浏览处要找到这个文件确定后,就能显示该文件的路径及文件名出来?
如果行请举个例,以便小弟学着做。 如不行那可以使用什么办法做到这个效果,我要的就是这个路径及文件名。
另外在DELPHI中怎样调用EXE文件也请举个例,谢谢!
问题点数:0、回复次数:6Top
1 楼greedy_wolf(我一直在寻找自己也不知道是什么的东西!)回复于 2005-06-01 16:46:43 得分 0
关注
帮你顶Top
2 楼hercules_123(glen)回复于 2005-06-01 17:25:04 得分 0
大家能来谈谈吗?Top
3 楼hercules_123(glen)回复于 2005-06-02 16:57:52 得分 0
怎么会没人帮我呀Top
4 楼wlbfeihu(下辈子不写程序)回复于 2005-06-02 17:10:30 得分 0
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
Edit1.Text:=OpenDialog1.FileName;
end;Top
5 楼wlbfeihu(下辈子不写程序)回复于 2005-06-02 17:13:54 得分 0
winExec('calc.exe',0);Top
6 楼csnight(午夜飞行)回复于 2005-06-02 17:15:53 得分 0
属性FILENAME返回所选择文件的路径和文件名
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Memo1: TMemo;
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
if OpenDialog1.Execute then
Memo1.Lines.Add(OpenDialog1.FileName)
else
Memo1.Lines.Clear;
end;
end.
Top




