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
// CopyFile(FileListBox1.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.