Solved

SMB Protocol, Download files from Windows Shared Folders?

Posted on 1999-01-26
8
616 Views
Last Modified: 2010-04-06
I need to download files from Windows Shared Folders in my Delphi app. The computers are outside my Network, so I need some kind of IP connection. Any help appreciated. Thanks in advance.
0
Comment
Question by:friberg
[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
  • 5
  • 2
8 Comments
 
LVL 3

Expert Comment

by:williams2
ID: 1363373
I hae done some researching into this area, and I cannot find any generel solution to this problem, therefore I have been developing my own implementation of this, but it is not to be published since I have put some hard time working into this subject. :-(

regards,
Williams
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363374
Those computers outside your network, do you have access to them. I mean do you have permission to install and configure software on them?
This is important because you have to set up a connection in some way and the remote computers have to allow you to do this.
And finally what kind of network is there between the systems? Are modems involved, internet, or whatever.
For a start you could look at Virtual Private Networking than comes with Windows 98.
See http://www.microsoft.com/workshop/server/feature/vpnovw.asp for more info.
With Virtual Private Networking you can access remote computers over the internet (or other tcp/ip network) like normal files. If this is not an option it is most likely to use an ftp-server on the remote computers.

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363375
If you really want to use SMB look at:

http://premium.microsoft.com/isapi/devonly/prodinfo/msdnprod/msdnlib.idc?theURL=/msdn/library/sdkdoc/cifs/cifs5_1gfm.htm

Search in the tree in the left frame for relevant info on SMB.

please feel free to ask what you don't know...

0
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!

 

Author Comment

by:friberg
ID: 1363376
Thanks Epsylon. I have read the SMB spec and have a pretty good idea of how it works. However, I don't know how to implement it in Delphi. I have "read access" to those computers outside my network, and the only feature I want in my Delphi app is file download (possibly a recursive file dir as well, so I know which files are possible to download). Those computers have a direct internet connection and a permanent IP address, so I don't think I have to use a Virtual Private Network.
Do you have a code example for this download feature? Or is it very hard to implement?
Thanks
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363377
Well, let's say that have 2 computers with tcp/ip protocol, client for Microsoft networks and file and printer sharing.
IP addresses are 192.168.0.1 and 192.168.0.2.
192.168.0.2 has c:\ shared as C. Then on 192.168.0.1 I can do:

CopyFile('\\192.168.0.2\c\windows\media\the microsoft sound.wav', 'c:\the microsoft sound.wav', True);

This will copy the file.

Or for example:

memo1.lines.LoadFromFile('\\192.168.0.2\c\autoexec.bat')

I am only not sure what you should do if you have to go through a proxyserver/firewall or other security stuff...

0
 

Author Comment

by:friberg
ID: 1363378
Thanks, just what I needed. It was easier than I thought. :-)
Could you please submit it as an answer?

0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1363379
Here it is...
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363380
Sometimes I see people creating pages of code when answering question here on experts exchange. When I can do it in just one line I get headaches when I see their code. Yes, it is many times easier that some people think. No offence to you intended. I was wise to ask it here. Actually you saved me a headache :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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