Solved

SMB Protocol, Download files from Windows Shared Folders?

Posted on 1999-01-26
8
581 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 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

20 Experts available now in Live!

Get 1:1 Help Now