学生上课传输文件系统程序
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 :
用户评论