Here's the code:
Code: Select all
procedure TfmTest.FormCreate(Sender: TObject);
begin
// get the user's temp folder. FErrorFile is a private variable in the form class
FErrorFile := IncludeTrailingPathDelimiter(GetEnvironmentVariable('TEMP'));
// append the file name
FErrorFile := FErrorFile + 'Error.log';
// tell madExcept where to create the file
MESettings.BugReportFile := FErrorFile;
end;
procedure TfmTest.MadHandlerExceptAction(action: TExceptAction; const exceptIntf: IMEException; var handled: Boolean);
var
InStream: TStringStream;
OutStream: TFileStream;
begin
if Action = eaSendBugReport3 then
begin
InStream := TStringStream.Create;
OutStream := TFileStream.Create(ExceptIntf.BugReportFile,fmCreate);
try
// put the bug report data into the TStringStream
InStream.WriteString(ExceptIntf.BugReport);
// reset position to 0
InStream.Position := 0;
// encrypt with LockBox DES encryption
LockBoxDES.EncryptStream(InStream,OutStream);
finally
// free the streams
InStream.Free;
OutStream.Free;
end;
end;
end;
One in the correct place, the user's TEMP folder: C:\Users\me\AppData\Local\Temp\Error.log. And it's encrypted.
But another one gets created, that's NOT encrypted, gets created in C:\Users\me\AppData\Local\Temp\MyTest.madExcept\Error.log.
What am I doing wrong?