Solved

SMB Protocol, Download files from Windows Shared Folders?

Posted on 1999-01-26
8
572 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

19 Experts available now in Live!

Get 1:1 Help Now