Solved

Ftp ~ ala Connect Network drive

Posted on 1998-11-06
5
210 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sending Gmail through Delphi 3 69
delphi exception 7 58
Best Firemonkey component pack 1 74
creating threads in delphi 1 55
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now