我在24楼的按钮里修改如下:请问是否又错
procedure TMailEditorForm.actNewAttachmentExecute(Sender: TObject);
var
I: Integer;
lOpenDialog: TMailOpenDialog;
lStream: TFileStream;
begin
lOpenDialog := TMailOpenDialog.Create(Self);
try
lOpenDialog.Filter := '所有文件(*.*)|*.*';
lOpenDialog.Options := lOpenDialog.Options + [ofAllowMultiSelect, ofFileMustExist];
if lOpenDialog.Execute then
begin
lStream := TFileStream.Create(OpenDialog.FileName, SysUtils.fmOpenRead);
if (lStream.Size) > 5368709120 then
begin
jsDialogs.ShowMsg('附件大小不能超过5M', '');
exit;
end;
for I := 0 to lOpenDialog.Files.Count - 1 do
msgMail.AddAttachment(lOpenDialog.Files[I]);
SetModified;
RefreshAttachs;
end;
BringWindowToTop(Handle);
// todo 以下两个过程,解决98下不能刷新的问题。
if Assigned(FTextEdit) then
FTextEdit.Refresh;
if Assigned(FDHTMLEdit) then
FDHTMLEdit.Refresh;
finally
lStream.Free;
lOpenDialog.Free;
end;
end;