|
try
dir:='C:\Documents and Settings\Administrator\Application Data\jserpDownloadedFiles';
if not sysutils.FileExists(dir) then//如果不存在此路径,则新建一个
begin
sysutils.CreateDir(dir);
//FileSys.FileSystem.CreateDirectory(dir);
end;
dir:=dir+'\'
+self.InfoBroker1.Info.DataSetByID('annex').FieldByName('annexname').asstring ;
//if self.SaveDialog1.Execute then begin
//self.fileExistsDown ;
//if goOnDown =false then exit;
TBlobField(Self.InfoBroker1.Info.DataSetByID('annex').FieldByName('AnnexContent')).SaveToFile(dir);
Borland.Delphi.ShellAPI.ShellExecute(0, 'open',PChar(dir), '', '', Borland.Delphi.Windows.SW_SHOW);
except on e:Exception do
begin
jsdialogs.ShowError('查看原始附件的过程中出现了异常,请检查你所要查看的附件是否已经打开或者没有附件对应的打开软件。','错误');
end;
问题是:比如dir最好组合为:C:\Documents and Settings\Administrator\Application Data\jserpDownloadedFiles\xpcmd.doc
执行到savetofile()时报错:不能创建这个路径
这是我到这个路径下看时xpcmd.doc是个文件夹(没有隐藏扩展名),
还有创建路径的函数,到底是哪一个啊,看bbs上有好几个。并且这个createdir()的返回值总是False。
这个事,搞得我有点晕了,在线等待。谢谢 |
|