Solved

SMB Protocol, Download files from Windows Shared Folders?

Posted on 1999-01-26
8
629 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

624 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