📄 zmod_commondatafileu.pas
字号:
{
'┌───────────────────────────────────┐
'│**********************************************************************│
'│*** 文件名称:zmod_commonDataFileU *│
'│*** 功能描述: *│
'│*** 编写人员:朱华 *│
'│*** 编写日期:2001-06-06 *│
'│*** 修改人员: *│
'│*** 修改日期: *│
'│**********************************************************************│
'└───────────────────────────────────┘
}
unit zmod_commonDataFileU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
Tzmod_commonDataFile = class(TDataModule)
private
{ Private declarations }
public
{ Public declarations }
end;
// 自定义过程、函数 — 开始
//
procedure zh_BackupDatabaseP(sou_path:string; tar_path:string);
procedure zh_WritePathnameP(file_name:string; file_content:string);
function zh_ReadPathnameF(file_name:string):string;
// 自定义过程、函数 — 结束
var
zmod_commonDataFile: Tzmod_commonDataFile;
zh_errorflag: boolean;
implementation
{$R *.DFM}
function zh_ReadPathnameF(file_name:string):string;
var
readfile :textfile;
file_content :string;
begin
//
AssignFile(readfile,file_name) ;
ReSet(readfile) ;
Read(readfile,file_content) ;
CloseFile(readfile) ;
zh_ReadPathnameF := file_content ;
//
end;
procedure zh_WritePathnameP(file_name:string; file_content:string);
var
writefile: textfile;
begin
//
AssignFile(writefile,file_name) ;
ReWrite(writefile);
Write(writefile,file_content);
writeln(writefile);
CloseFile(writefile);
//
end;
procedure zh_BackupDatabaseP(sou_path:string; tar_path:string);
var
source :TFileStream;
target :TFileStream;
begin
//
try
zh_errorflag := False ;
source:= TFileStream.Create (sou_path,fmOpenRead);
target:=TFileStream.Create (tar_path,fmOpenWrite or fmCreate);
target.CopyFrom(source, source.Size);
source.Free ;
target.Free ;
except
zh_errorflag := True ;
end;
//
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -