社区
Delphi
帖子详情
用findfirst('c:\ling\*.*',faAnyFile,rc);???????
nancy_song
2002-04-10 04:48:57
var
rc:TSearchRec;
用findfirst('c:\ling\*.*',faAnyFile,rc);
我知道此目录下肯定有文件存在。
为什么rc.name的返回值是'.'?
...全文
77
5
打赏
收藏
用findfirst('c:\ling\*.*',faAnyFile,rc);???????
var rc:TSearchRec; 用findfirst('c:\ling\*.*',faAnyFile,rc); 我知道此目录下肯定有文件存在。 为什么rc.name的返回值是'.'?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
doctor5
2002-04-11
打赏
举报
回复
楼上说的对,还得用FINDNEXT去找
猛禽
2002-04-10
打赏
举报
回复
本来就是这样的,第一个就是'.',第二个是'..',第三个开始才是文件
nancy_song
2002-04-10
打赏
举报
回复
outer2000(天外流星):
我就是用是否等于0来判断的,而且函数的返回值是0,但它返回的还是.,和..
我看过delphi的例子,按理来说这种情况是不应出现的。
killers100
2002-04-10
打赏
举报
回复
用fileexist()来看是否文件存在啊,
outer2000
2002-04-10
打赏
举报
回复
表示当前目录啊,没什么的;如果要判断该目录有文件需要
VAR I:INTEGER;
I:=FINDFIRST(。。。)
如果I等于0表示找到。
DELPHI TXT 树文档 管理器
unit TreeViewFunctions; interface uses Windows, Messages, SysUtils, Variants, Classes, ComCtrls, Controls, Forms,
File
Ctrl, StrUtils, Masks, Vcl.OleCtrls, SHDocVw, IOUtils; procedure SaveTreeViewExplandState(TreeView: TTreeView;
File
Name: string); procedure LoadTreeViewExplandState(TreeView: TTreeView;
File
Name: string); function ExtractNewFolderPath(
File
Name: string; NewText: string): string; procedure HideHideHorizontalScrollBar(TreeView: TTreeView); function IsEmptyDir(sDir: String): Boolean; function AttachMentsExists(
File
Name: String): Boolean; procedure SetIcons(TreeView: TTreeView; list: TStringList); procedure EnumText(s: string; aItem: TTreeNode); function AttachmentsFolder(
File
Name: String): string; function ExtractNodeFullPath(TreeView: TTreeView): string; function Get_node_path(node: TTreeNode): string; function ExtractTreeView
File
Name(RootPath: string; TreeView: TTreeView): string; /// /// Node.Selected := true; Node.Focused := true; /// /// /// Node.Selected := true; Node.Focused := true; /// /// /// Node.Selected := true; Node.Focused := true; /// function Open
File
(Path: string; RichEdit: TRichEdit; TreeView: TTreeView) : Boolean; overload; function Open
File
(Path: string; Webbrowser: TWebbrowser; TreeView: TTreeView) : Boolean; overload; procedure GetDirectories(Tree: TTreeView; Directory: string; Item: TTreeNode; Include
File
s: Boolean); procedure DirToTreeView(Tree: TTreeView; Directory: string; Root: TTreeNode; Include
File
s: Boolean;
File
Ext: string); procedure QSetPerpoty(TreeView: TTreeView); function ItemExist(Text: string; TreeView: TTreeView): Boolean; function RemoveDirs(folderPath: string): Boolean; function __Rename
File
(OldName: string; Title: string): Boolean; function RenameFolder(
file
Path: string; Title: string): Boolean; var list: TStringList; implementation { // "D:\C++Builder学习大全中文版\index.htm" // "D:\C++Builder学习大全中文版\" // "index_
file
s" // "D:\C++Builder学习大全中文版\index_
file
s" var s, s1, s2: string; begin s := 'D:\C++Builder学习大全中文版\index.htm'; s1:=ExtractNewFolderPath(s,'_
file
s'); s2 := ExtractNewFolderPath(s, '_AttachMents'); Memo1.
lin
es.Add(s); Memo1.
Lin
es.Add(s1); Memo1.
lin
es.Add(s2); end; } function ExtractNewFolderPath(
File
Name: string; NewText: string): string; var _
file
sFolder: string; // "D:\C++Builder学习大全中文版\" _
file
sFolderName: string; // "index_
file
s" _
file
sFolderPath: String; begin _
file
sFolder := Extract
File
Path(
File
Name); _
file
sFolderName := Change
File
Ext(Extract
File
Name(
File
Name), '') + NewText; _
file
sFolderPath := _
file
sFolder + _
file
sFolderName; Result := _
file
sFolderPath; end; { SaveTreeViewExplandState(TreeView1,'TreeView.txt'); } procedure SaveTreeViewExplandState(TreeView: TTreeView;
File
Name: string); var list: TStringList; i: Integer; begin list := TStringList.Create; With TreeView do begin for i := 0 to Items.Count - 1 do begin if Items.Item[i].Expanded then list.Add(IntToStr(i)); end; list.Add(IntToStr(Selected.AbsoluteIndex)); end; list.SaveTo
File
(
File
Name); list.free; end; { LoadTreeViewExplandState(TreeView1, 'abc.txt'); } procedure LoadTreeViewExplandState(TreeView: TTreeView;
File
Name: string); var list: TStringList; i: Integer; node: TTreeNode; begin list := TStringList.Create; with list do begin list.LoadFrom
File
(
File
Name); for i := 0 to Count - 2 do // 最后一行放的是最后选中的那个节点索引 begin TreeView.Items[StrToInt(list[i])].Expand(False); end; node := TreeView.Items[StrToInt(list[Count - 1])]; TreeView.Select(TreeView.Items[StrToInt(list[Count - 1])], []); // node.Selected := True; // node.Focused := True; TreeView.SetFocus; TreeView.Focused; free; end; end; { FUNCTION ulong ShowScrollBar(ulong hwnd,ulong wBar,ulong bShow) LIBRARY "user32.dll" constant long SB_HORZ = 0 constant long SB_VERT = 1 constant long SB_BOTH = 3 } procedure HideHideHorizontalScrollBar(TreeView: TTreeView); begin // no responed NEW FORM TEST // ShowScrollBar(TreeView.Handle,SB_HORZ,False); end; // procedure // begin // { 当拖拽的高度不够的时候自动滚动滚动条 } // with TreeView1 do // begin // if (Y < 15) then // SendMessage(Handle, WM_VSCROLL, SB_
LIN
EUP, 0) // else if (Height - Y < 15) then // SendMessage(Handle, WM_VSCROLL, SB_
LIN
EDOWN, 0); // end; // end; { 返回 附件文件夹 "D:\C++Builder学习大全中文版\新建文本文档.htm" D:\C++Builder学习大全中文版\新建文本文档_Attachments } function AttachmentsFolder(
File
Name: String): string; begin Result := Extract
File
Path(
File
Name) + Change
File
Ext(Extract
File
Name(
File
Name), '') + '_Attachments'; end; function AttachMentsExists(
File
Name: String): Boolean; var f: string; begin f := Extract
File
Path(
File
Name) + Change
File
Ext(Extract
File
Name(
File
Name), '') + '_Attachments'; Result := DirectoryExists(f); end; procedure EnumText(s: string; aItem: TTreeNode); var node: TTreeNode; str: string; begin node := aItem; while node nil do begin if s = '' then str := node.Text else str := s + '\' + node.Text; list.Add(str); /// ////////////////////////// if node.HasChildren then EnumText(str, node.getFirstChild); node := node.getNextSib
lin
g; end; end; function IsEmptyDir(sDir: String): Boolean; var sr: TSea
rc
hRec; begin Result := True; if Copy(sDir, Length(sDir) - 1, 1) '\' then sDir := sDir + '\'; if FindFirst(sDir + '*.*',
faAny
File
, sr) = 0 then repeat if (sr.Name '.') and (sr.Name '..') then begin Result := False; break; end; until FindNext(sr) 0; FindClose(sr); end; { 是文件 夹的设置为1 是文件 的设置为 2 } procedure SetIcons(TreeView: TTreeView; list: TStringList); var i: Integer; begin with TreeView do begin for i := 0 to Items.Count - 1 do begin if DirectoryExists(list.Strings[i]) then begin Items[i].ImageIndex := 0; Items[i].SelectedIndex := 0; Items[i].StateIndex := 0; end; if
File
Exists(list.Strings[i]) then begin Items[i].ImageIndex := 1; Items[i].SelectedIndex := 1; Items[i].StateIndex := 1; end; if (AttachMentsExists(list.Strings[i])) then if not IsEmptyDir(AttachmentsFolder(list.Strings[i])) then begin // Form1.Memo1.
LIN
ES.Add( AttachmentsFolder(list.Strings[i])); Items[i].ImageIndex := 2; Items[i].SelectedIndex := 2; Items[i].StateIndex := 2; end; end; end; end; procedure QSetPerpoty(TreeView: TTreeView); begin with TreeView do begin // Align := alBottom; // Anchors := [akLeft, akTop, akBottom, akRight]; Items.Clear; // BorderStyle := bsNone; Cursor := crHandPoint; ReadOnly := True; ShowHint := True; RowSelect := True; ShowButtons := True; ShowRoot := True; Show
Lin
es := False; SortType := stText; HideSelection := False; RightClickSelect := True; DragMode := dmAutomatic; // Color := RGB(238, 243, 246); end; end; { 实际重命名 C:\windows\test.txt C:\windows\csadsajas.txt Move
File
(PChar('C:\1.txt'),PChar('C:\ABC.txt')); if not __Rename
File
('C:\tree.txt','TreeView') then Application.MessageBox('重命名文件失败','重命名',MB_ICONERROR); } { 重命名文件 } function __Rename
File
(OldName: string; Title: string): Boolean; var NewName: string; begin NewName := Format('%s%s%s', [Extract
File
Path(OldName), Title, Extract
File
Ext(OldName)]); Result := Move
File
(PChar(OldName), PChar(NewName)); end; // 重命名文件夹 // RenameFolder('C:\1\','2'); // Move
File
('C:\1','C:\2'); // Move
File
('C:\1\','C:\2\'); function RenameFolder(
file
Path: string; Title: string): Boolean; var s, s1: string; begin //
file
Path:='C:\Windows\System32\'; // s = Extract
File
Dir(
file
path) = 'C:\Windows\System32' s := Extract
File
Dir(
file
Path); // s1 = Extract
File
Dir(s) = 'C:\Windows' // s1 ='C:\Windows' +'\'+ titles s1 := Extract
File
Dir(s) + '\' + Title; Result := Move
File
(PChar(s), PChar(s1)); end; { IOUtils } function RemoveDirs(folderPath: string): Boolean; begin Result := False; if TDirectory.IsEmpty(folderPath) then begin TDirectory.Delete(folderPath); Result := True; end else begin if Application.MessageBox('确定要删除这个文件夹吗? 删除后无法恢复!', '提示', MB_ICONQUESTION + MB_YESNO) = ID_YES then begin TDirectory.Delete(folderPath, True); Result := True; end; end; // if TDirectory.Exists(folderPath) then // begin // Application.MessageBox('删除文件失败'+#13#10+'文件正确被使用?','错误',MB_ICONERROR+MB_OK); // Result:=False; // end; end; { if not ItemExist('Edit1.Text',TreeView1) then TreeView1.Items.AddChild(Treeview1.Selected,'Edit1.Text'); } function ItemExist(Text: string; TreeView: TTreeView): Boolean; var i: Integer; begin Result := False; if (Trim(Text) '') then begin for i := 0 to TreeView.Items.Count - 1 do if Trim(Text) = Trim(TreeView.Items[i].Text) then begin Result := True; Exit; end; end; Result := False; end; // ------------------------------------------------------------------------------ { TreeView获得选中的完整路径 aaaa\ssss\bbbb } function ExtractNodeFullPath(TreeView: TTreeView): string; var Path: string; Parent: TTreeNode; // Node: TTreeNode; begin Path := TreeView.Selected.Text; Parent := TreeView.Selected.Parent; while Parent nil do begin Path := Parent.Text + '\' + Path; Parent := Parent.Parent; end; Result := Path; end; function Get_node_path(node: TTreeNode): string; var Path: string; TreeNode: TTreeNode; begin Path := node.Text; TreeNode := node.Parent; while TreeNode nil do begin Path := TreeNode.Text + '\' + Path; TreeNode := TreeNode.Parent; end; Result := Path; end; { 获得文件完整路径 C:\abc\int.cpp } function ExtractTreeView
File
Name(RootPath: string; TreeView: TTreeView): string; var
File
Name: string; begin Result := ''; if TreeView.Selected = nil then Exit;
File
Name := RootPath + ExtractNodeFullPath(TreeView); // 当前选中的文件名 if not
File
Exists(
File
Name) then Exit; Result :=
File
Name; end; { 用RICHEDIT打开TREEVIEW中的文件 } function Open
File
(Path: string; RichEdit: TRichEdit; TreeView: TTreeView) : Boolean; overload; var
File
Name: string; begin Result := False;
File
Name := ExtractTreeView
File
Name(Path, TreeView); if
File
Exists(
File
Name) then begin RichEdit.
Lin
es.LoadFrom
File
(
File
Name); Result := True; end end; function Open
File
(Path: string; Webbrowser: TWebbrowser; TreeView: TTreeView) : Boolean; overload; var
File
Name: string; begin Result := False;
File
Name := ExtractTreeView
File
Name(Path, TreeView); if
File
Exists(
File
Name) then begin Webbrowser.Navigate(
File
Name); Result := True; end end; { 将1个目录里面所有的文件添加到TREEVIEW中 GetDirectories(TreeView1, 'D:\DATA', nil, True); } procedure GetDirectories(Tree: TTreeView; Directory: string; Item: TTreeNode; Include
File
s: Boolean); var Sea
rc
hRec: TSea
rc
hRec; ItemTemp: TTreeNode; begin Tree.Items.BeginUpdate; if Directory[Length(Directory)] '\' then Directory := Directory + '\'; if FindFirst(Directory + '*.*', faDirectory, Sea
rc
hRec) = 0 then begin repeat if (Sea
rc
hRec.Attr and faDirectory = faDirectory) and (Sea
rc
hRec.Name[1] '.') then begin if (Sea
rc
hRec.Attr and faDirectory > 0) then Item := Tree.Items.AddChild(Item, Sea
rc
hRec.Name); ItemTemp := Item.Parent; GetDirectories(Tree, Directory + Sea
rc
hRec.Name, Item, Include
File
s); Item := ItemTemp; end else if Include
File
s then if Sea
rc
hRec.Name[1] '.' then Tree.Items.AddChild(Item, Sea
rc
hRec.Name); until FindNext(Sea
rc
hRec) 0; FindClose(Sea
rc
hRec); Tree.Items.EndUpdate; end; end; { 将1个目录里面所有的文件添加到TREEVIEW中 DirToTreeView(TreeView1,'D:\Data\',nil,True,'.cpp'); } procedure DirToTreeView(Tree: TTreeView; Directory: string; Root: TTreeNode; Include
File
s: Boolean;
File
Ext: string); var Sea
rc
hRec: TSea
rc
hRec; Node1: TTreeNode; begin with Tree.Items do begin BeginUpdate; if Directory[Length(Directory)] '\' then Directory := Directory + '\'; if FindFirst(Directory + '*.*', faDirectory, Sea
rc
hRec) = 0 then begin Application.ProcessMessages; repeat { 添加文件夹 } if (Sea
rc
hRec.Attr and faDirectory = faDirectory) and (Sea
rc
hRec.Name[1] '.') then begin if SameText(RightStr(Sea
rc
hRec.Name, 12), '_AttachMents') then // 不添加 _AttachMents这个文件夹 Continue; if (Sea
rc
hRec.Attr and faDirectory > 0) then Root := AddChild(Root, Sea
rc
hRec.Name); Node1 := Root.Parent; DirToTreeView(Tree, Directory + Sea
rc
hRec.Name, Root, Include
File
s,
File
Ext); Root := Node1; end else if Include
File
s then { 添加文件 } if Sea
rc
hRec.Name[1] '.' then { .TXT .txt .TxT .tXT 为一样的 } if SameText(RightStr(Sea
rc
hRec.Name, 4),
File
Ext) then { 只添加 .CPP格式文件 } AddChild(Root, Sea
rc
hRec.Name); until FindNext(Sea
rc
hRec) 0; FindClose(Sea
rc
hRec) end; EndUpdate; end; end; end.
DELPHI搜索文件的示例
搜索TXT 文件的示例unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ExtCtrls; type TForm1 = class(TForm) ListBox1: TListBox; Memo2: TMemo; Panel1: TPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Edit1: TEdit; ButtonSea
rc
h
File
: TButton; FolderPath: TEdit;
File
Ext: TEdit; ProgressBar1: TProgressBar; procedure ButtonSea
rc
h
File
Click(Sender: TObject); procedure ListBox1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } procedure Sea
rc
h
File
1(
File
Name: string; FindText: string); function Make
File
List(Path,
File
Ext: string): TStringList; function
File
InUsed(
File
Name: T
File
Name): Boolean; public { Public declarations } end; var Form1: TForm1; implementation uses StrUtils; {$R *.dfm} { Sea
rc
h Options KeyWord in
file
File
Name
File
Size
File
CreateTime
File
ModifyTime keyword
file
path open
file
found addListbox } var
File
NamePathList,
File
NameList: TStringList; procedure TForm1.FormCreate(Sender: TObject); begin
File
NameList := TStringList.Create;
File
NamePathList := TStringList.Create; end; { if
File
InUsed ('D:\Administrator\Documents\MyProjects\
File
Sea
rc
h\Win32\Debug\Project1.exe') then ShowMessage('
File
is in use.') else ShowMessage('
File
not in use.'); } function TForm1.
File
InUsed(
File
Name: T
File
Name): Boolean; var H
File
Res: H
FILE
; begin Result := False; if not
File
Exists(
File
Name) then Exit; // 如果文件不存在,返回false H
File
Res := Create
File
(PChar(
File
Name), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING,
FILE
_ATTRIBUTE_NORMAL, 0); Result := (H
File
Res = INVALID_HANDLE_VALUE); if not Result then CloseHandle(H
File
Res); end; procedure TForm1.Sea
rc
h
File
1(
File
Name: string; FindText: string); var Sea
rc
hList: TStringList; begin try Sea
rc
hList := TStringList.Create; if
File
Exists(
File
Name) and (not
File
InUsed(
File
Name)) then begin Sea
rc
hList.LoadFrom
File
(
File
Name); if Boolean(Pos(Uppe
rC
ase(FindText), Uppe
rC
ase(Sea
rc
hList.Text))) then begin
File
NameList.Add(Extract
File
Name(
File
Name));
File
NamePathList.Add(
File
Name); end; end; finally Sea
rc
hList.Free; end; end; procedure TForm1.ButtonSea
rc
h
File
Click(Sender: TObject); var I, n: Integer; List: TStringList; begin try ButtonSea
rc
h
File
.Caption := 'Sea
rc
h
File
'; List := TStringList.Create; List.Clear;
File
NameList.Clear;
File
NamePathList.Clear; List := Make
File
List(FolderPath.Text,
File
Ext.Text); ProgressBar1.Max := List.Count; for I := 0 to List.Count - 1 do begin Application.ProcessMessages; Sea
rc
h
File
1(List[I], Edit1.Text); ProgressBar1.Position := I; end; ListBox1.Items.Text :=
File
NameList.Text; ButtonSea
rc
h
File
.Caption := IntToStr(
File
NamePathList.Count) + ' 条'; finally List.Free; end; end; { 这个过程得显示进度 } function TForm1.Make
File
List(Path,
File
Ext: string): TStringList; var sch: TSea
rc
hrec; begin Result := TStringList.Create; if RightStr(Trim(Path), 1) '\' then Path := Trim(Path) + '\' else Path := Trim(Path); if not DirectoryExists(Path) then begin Result.Clear; Exit; end; if FindFirst(Path + '*',
faAny
file
, sch) = 0 then begin repeat Application.ProcessMessages; if ((sch.Name = '.') or (sch.Name = '..')) then Continue; if DirectoryExists(Path + sch.Name) then begin Result.AddStrings(Make
File
List(Path + sch.Name,
File
Ext)); end else begin if (Uppe
rC
ase(Extract
File
Ext(Path + sch.Name)) = Uppe
rC
ase(
File
Ext)) or (
File
Ext = '.*') then Result.Add(Path + sch.Name); end; until FindNext(sch) 0; FindClose(sch); end; end; procedure TForm1.ListBox1Click(Sender: TObject); var s: string; txt: string; begin if not
File
Exists(
File
NamePathList[ListBox1.ItemIndex]) then Exit; Memo2.
Lin
es.LoadFrom
File
(
File
NamePathList[ListBox1.ItemIndex]); Caption :=
File
NamePathList[ListBox1.ItemIndex]; txt := Form1.Memo2.Text; if Boolean(Pos(Uppe
rC
ase(Edit1.Text), Uppe
rC
ase(txt))) then begin Memo2.SetFocus; Memo2.SelStart := Pos(Uppe
rC
ase(Edit1.Text), Uppe
rC
ase(txt)) - 1; Memo2.SelLength := Length(Edit1.Text); end; end; end.
Delphi7 读取 windows7 IE收藏夹内容.rar
Delphi7 读取 windows7 IE收藏夹内容,这个是获取收藏夹里面的网址,不显示网址标题,如下图所示的效果,要用到标题了自己修改代码吧。 获取收藏夹主要是以下代码实现: SHGetSpecialFolderLocation(Handle, CSIDL_FAVORITES, pidl); SHGetPathFromIDList(pidl, favpath); Memo1.
Lin
es := GetFavorites(StrPas(FavPath)); 获取在favourites 路径下的所有名字: path := FavPath '\*.url'; dir := Extract
File
path(path); found := FindFirst(path,
faAny
File
, sea
rc
hrec); 然后再从
file
s变量读URLs
发送程序-源码
unit uMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask, RzEdit, RzButton, ExtCtrls, Ini
File
s, RzTabs, ComCtrls, RzListVw, RzShellCtrls, ImgList, RzShellDialogs, RzCmboBx, Q
RC
trls, QuickRpt, jpeg, ShlObj, RzPanel, RzSplit, RzTreeVw, DB, ADODB, Provider, DBClient, GridsEh, DBGridEh, RzStatus; type PShellItem = ^TShellItem; TShellItem = record FullID, ID: PItemIDList; Empty: Boolean; DisplayName, TypeName: string; ImageIndex, Size, Attributes: Integer; ModDate: string; end; TfrmMain = class(TForm) RzPageControl1: TRzPageControl; TabSheet1: TRzTabSheet; TabSheet2: TRzTabSheet; lbl1: TLabel; edt_Path1: TRzEdit; btn_o2: TButton; Button1: TButton; SplPreview: TRzSplitter; img1: TImage; RzToolbar1: TRzToolbar; RzSpacer1: TRzSpacer; ClientDS_PicCap: TClientDataSet; DataSP_PicCap: TDataSetProvider; Qry_PicCap: TADOQuery; Ds_PicCap: TDataSou
rc
e; DBGridEh1: TDBGridEh; ClientDataSetH: TClientDataSet; DataSetProviderH: TDataSetProvider; QueryH: TADOQuery; DataSou
rc
eH: TDataSou
rc
e; RzBtn_0: TRzBitBtn; RzBtn_1: TRzBitBtn; ImageList1: TImageList; Memo1: TMemo; ClientDS_PicCapacc_id_only: TStringField; ClientDS_PicCapname: TStringField; ClientDS_PicCapplate_num: TStringField; ClientDS_PicCapplate_type: TStringField; ClientDS_PicCapInsDate: TDateTimeField; ClientDS_PicCapAcc_ID_Only_1: TStringField; ClientDS_PicCapfDateTime: TDateTimeField; ClientDS_PicCapPicturePath1: TStringField; ClientDS_PicCapPicturePath2: TStringField; ClientDS_PicCapPicturePath3: TStringField; ClientDS_PicCapPicturePath4: TStringField; ClientDS_PicCapPicturePath5: TStringField; ClientDS_PicCapPicturePath6: TStringField; ClientDS_PicCapPicturePath7: TStringField; ClientDS_PicCapPrintCount: TIntegerField; ClientDataSetHAutoID: TAu
Delphi 7.0 调用外部exe文件的例子源代码.rar
Delphi 7.0 调用外部exe文件的例子源代码,通过程序窗口,你可浏览到windows中任意的EXE可执行文件,本程序将调用它并打开它,在Delphi程序中打开外部的EXE程序,相关代码片断先看看: begin di
rc
har:=''; if trim(
File
LIst.
File
Name) '' then begin
File
Attrs :=
faAny
File
; st
rc
at(di
rc
har,pchar(
File
List.
File
Name)); if findfirst(di
rc
har,
File
Attrs,sr)=0 then //执行可执行文件 shellexecute(application.Handle,nil,di
rc
har,nil,nil,sw_shownormal) else showmessage('该文件不存在!'); end; end; 完整的源码请点击下载按钮下载源码。
Delphi
5,392
社区成员
262,731
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章