当选择*.HTML过滤,则FILELISTBOX(WIN31)中出现两个同名文件

polaris 2000-03-14 02:42:00
为什么我在FILTER控件(WIN31)中设了*.*与*.HTML两个过滤值后,每当选择HTML过滤,则FILELISTBOX(WIN31)中出现两个同名文件,对其中任何一个文件操作如改名编辑都同样有效,不知为什么会有这种怪现象?
...全文
104 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
kxy 2000-03-15
  • 打赏
  • 举报
回复
不是有source吗,看看,或者跟踪一下,
verve 2000-03-14
  • 打赏
  • 举报
回复
我当时一个用*.*,另一个用*.Html and *.Htm,
但FileListBox显示两个文件,
其实只有一个,比如是ABC.Html
WHY?
csdn2000 2000-03-14
  • 打赏
  • 举报
回复
WIN31只支持8.3格式的文件名,不支持长文件名。 *.HTML的扩展名为四位,属长文件名。
Lin 2000-03-14
  • 打赏
  • 举报
回复
??
是不是扩展名不一样啊?一个为*.html,而另一个为*.htm?这两类文件Windows都显示成Microsoft HTML Document。
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, FileCtrl, IdBaseComponent, ShellApi,IdComponent, IdIPWatch, ExtCtrls, jpeg; type TForm1 = class(TForm) FileListBox1: TFileListBox; Button1: TButton; DirectoryListBox1: TDirectoryListBox; DriveComboBox1: TDriveComboBox; FilterComboBox1: TFilterComboBox; Edit1: TEdit; Label1: TLabel; Button2: TButton; Label2: TLabel; Memo1: TMemo; Label3: TLabel; IdIPWatch1: TIdIPWatch; Label4: TLabel; Button3: TButton; Edit2: TEdit; Label5: TLabel; Label6: TLabel; Label7: TLabel; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FileListBox1DblClick(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Label3Click(Sender: TObject); procedure Label4Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; a1:integer; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var str5: string; begin begin str5 := InputBox('输入姓名', 'Name:', ''); // Application.Terminate; // 退出程序 if str5 ='' then showmessage('没有输入姓名,请重新输入') else begin ShowMessage(str5); //显示输入的内容 CopyFile(pchar(string(FileListBox1.FileName)), pchar('\\10.10.3.167\stu\' + str5+copy(IdIPWatch1.LocalIP,9,3)+Edit1.text), false); Application.MessageBox('已经复制到老师机子里了', '提示', MB_OK) // Application.Terminate; // 退出程序 end ; end; end; procedure TForm1.FormCreate(Sender: TObject); begin self.FileListBox1.FileEdit :=self.Edit1 ; self.FilterComboBox1.FileList :=self.FileListBox1 ; self.DirectoryListBox1.FileList :=self.FileListBox1 ; self.DirectoryListBox1.DirLabel :=self.Label1 ; self.DriveComboBox1.DirList :=self.DirectoryListBox1 ; self.Button1.Default :=true; self.Button3.Visible :=false; end; procedure TForm1.FileListBox1DblClick(Sender: TObject); begin // CopyFileFileListBox1.FileName,FileListBox1.FileName,False); //CopyFile(pchar(string(FileListBox1.FileName)), pchar('\\10.10.3.167\stu\' +copy(IdIPWatch1.LocalIP,9,3)+ Edit1.text), false); //Application.MessageBox('已经复制到老师机子里了', '提示', MB_OK) ShellExecute(handle,'open', pchar(string(FileListBox1.FileName)), nil, nil, SW_SHOWNORMAL); end; procedure TForm1.Button2Click(Sender: TObject); begin Application.Terminate; // 退出程序 end; procedure TForm1.Label3Click(Sender: TObject); begin memo1.Lines.LoadFromFile(getcurrentdir+'\a.txt'); end; procedure TForm1.Label4Click(Sender: TObject); begin memo1.Lines.LoadFromFile(getcurrentdir+'\a1.txt'); end; procedure TForm1.Button3Click(Sender: TObject); var str6: string; begin begin str6 := InputBox('输入窗口标题', '输入提示', '默认输入内容'); ShowMessage(str6); //显示输入的内容 memo1.Lines.SaveToFile('\\10.10.3.167\stu\' + copy(IdIPWatch1.LocalIP,9,3)+str6+'.txt'); Application.MessageBox('你的作业已经复制到老师机子里了', '提示', MB_OK) end; end; end.

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧