?
Solved

How do I save a file over the UNC Path?

Posted on 2007-10-15
3
Medium Priority
?
1,249 Views
Last Modified: 2008-01-09
I want to save a Stringlist to a File with the UNC-Filename, without mapping the Ressource, in Delphi.

0
Comment
Question by:samurai34
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 200 total points
ID: 20080453
okm the obvious bits are
var
  sl: tstringlist;
...
sl.savetofile('\\somepc\someshare\file.txt');

if you do not have access (requires auth) then I think it's
 WMNetAddConnection or  WMNetAddConnection2 or something like that...
you do not need to provide a drive letter for the mapping
(away from delphi atm, will check later, or someone else will fill you in)
the equivalent of doing
net use \\somepc\someshare password /user:someuser /persistent:no
from the cmd prompt

0
 
LVL 17

Assisted Solution

by:TheRealLoki
TheRealLoki earned 200 total points
ID: 20083203
http://www.swissdelphicenter.ch/torry/showcode.php?id=745
change Button1Click to do
  ConnectDrive('', '\\Servername\C', True, False);

0
 
LVL 5

Expert Comment

by:Steven-Fernandez
ID: 20089574
Are you using a Dialog to save or do you insert the path in your code?

Either way just use the '\\' at the beginning of the path (Take off any drive specifications like C:\ etc...)

Example:

('c:\Yourpath\yourfile.ext')  would like like this ('\\yourpath\yourfile.ext')

If you are using the Dialogs just browser the network to the desiredv location.

 
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question