Solved

Ftp ~ ala Connect Network drive

Posted on 1998-11-06
5
225 Views
Last Modified: 2010-04-04
Hi there

Short question, but probaly rather dificult :-(

Is there a way to connect a FTP page as connecting a network drive, so you can browse the FTP page as your own drive (I only need to download files from the page)
0
Comment
Question by:koger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345945
koger

This is possible I have seen it done in ipswitch FTPPro, when you connect to an FTP site it adds it into your windows explorer as a "Mapped Drive" and you can browser the FTP from there, Maybe what you can do is once connect map a network drive to this connection then explorer etc will look at it as a drive until the connection is killed, you could use the API call WNetAddConnection2W like so

  function WNetAddConnection2W(var lpNetResource: TNetResourceW;
    lpPassword, lpUserName: PWideChar;
    dwFlags: DWORD): DWORD; stdcall;

then map the network drive from a button click or so...

procedure TForm1.Button1Click(Sender: TObject);
var
  NRW: TNetResource;
begin
  with NRW do
  begin
    dwType := RESOURCETYPE_ANY;
    lpLocalName := 'X:'; // map to this driver letter
    lpRemoteName := '\\MyServer\MyDirectory';
    // Must be filled in.  If an empty string is used,
    // it will use the lpRemoteName.
    lpProvider := '';
  end;
  WNetAddConnection2(NRW, 'MyPassword', 'MyUserName',
    CONNECT_UPDATE_PROFILE);
end;

Once you have the connection and the mapped drive execute windows explorer

ShellExecute(Handle, 'open', 'explorer.exe', 'Your mapped drive here', '', SW_SHOWNORMAL);

and you should have a mapped drive to the connection which will allow you to browse it in the windows explorer...

Hope this is what you are after...

Later
BoRiS
0
 

Author Comment

by:koger
ID: 1345946
Hi, sorry for the long reply.

lpRemoteName := '\\MyServer\MyDirectory';

Isn't this a network adresse.

Where should I put the Host adresse.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345947
koger

right were the lpProvider space is...

lpProvider := 'ftp://ftp.cdrom.com';

lpRemoteName is npnc (\\...\...) but this is required for the mapped drive to map correctly
you could connect to the server and then retrieve the directory and pass it to the lpRemoteName

Later
BoRiS
0
 

Author Comment

by:koger
ID: 1345948
Oh, okay, just make an answer so can get your points ;-)
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 100 total points
ID: 1345949
koger

Here you go, as asked just an answer for the points...

Later
BoRiS
0

Featured Post

Independent Software Vendors: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

728 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