win10文件粉碎機(jī) delphi怎么點(diǎn)擊按鈕就可以打開指定路徑里的文件?
delphi怎么點(diǎn)擊按鈕就可以打開指定路徑里的文件?Unit1接口窗口、消息、系統(tǒng)工具、變體、類、圖形、控件、窗體、對(duì)話、stdctrls、文件控制,shellapi//請(qǐng)注意,shellexecut
delphi怎么點(diǎn)擊按鈕就可以打開指定路徑里的文件?
Unit1接口窗口、消息、系統(tǒng)工具、變體、類、圖形、控件、窗體、對(duì)話、stdctrls、文件控制,shellapi//請(qǐng)注意,shellexecute需要引用shellapi單元類型TForm1=class(tform)filelistbox1:tfilelistbox button1:tbutton procedure button1click(sender:tobject)procedure FileListBox1Click(sender:tobject)private{private declarations}public{public declarations}endvar Form1:TForm1實(shí)現(xiàn){$R*.dfm}過程TForm1.button1單擊(發(fā)送方:TObject)開始self.FileListBox1文件. Directory:=“C:1”//設(shè)置文件列表endprocedure TForm1的路徑。Filelistbox1click(發(fā)件人:ToObject)begin ShellExecute(應(yīng)用程序。句柄,“打開”,pchar(self.FileListBox1文件.FileName),nil,nil,SW Show normal)//調(diào)用外部程序打開相應(yīng)的文件endend。//使用win3.1面板下的filelistbox控件