Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > VCL

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2010, 05:36 AM
Psykore Psykore is offline
Member
 
Join Date: May 2004
Posts: 42
Default SaveToFile with username and password?

Hi all,
I've created a service that retrieves a filepath from a database field, generates xml files and saves the files to this filepath.

I use the standard StringList.SaveToFile procedure :
Code:
var str : TStringList;
begin
   str := TStringList.Create;
   str.Add('some xml tags');
   str.SaveToFile(filepath + '.xml');
   str.Free;
end;
This all works fine. The problem is, this folder I am trying to save the files to is password protected. Is there a way I can still save files to this directory if I have the username and password?

Thanks.
Reply With Quote
  #2  
Old 05-11-2011, 01:17 PM
kgough kgough is offline
Junior Member
 
Join Date: May 2011
Posts: 2
Default SaveToFile incorrect password

Did you find a solution for this?
I am having the same problem, but with Borland C++.
I am trying to save the file to a device where I know the user name / password, but I cannot change the security.

Maybe there is a way to log in before using SaveToFile?
Reply With Quote
  #3  
Old 05-11-2011, 01:51 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

Perhaps this link is usefull: delphi3000
Reply With Quote
  #4  
Old 05-12-2011, 07:07 PM
kgough kgough is offline
Junior Member
 
Join Date: May 2011
Posts: 2
Default

CreateProcessWithLogonW did not work for me.

It failed to login to the remote device.
Instead it used the credentials I gave it to try to switch accounts on the local machine.

So I changed tactics. I will map the device to a local drive and write to it with SaveToFile.

Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:31 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.