Search code examples
c#smbnetwork-share

Create smb server in order to share files


Most of the places online explain how to connect and read data hosted by a smb server. Wikipedia explains more about smb at:

http://en.wikipedia.org/wiki/Server_Message_Block

So what I am trying to do is to be able to open a file (located on the internet) from windows eplorer as:

enter image description here

I need to add this functionality to a program that I am creating. If it is to complicated to create such server I guess I will not do it but I want to try my best. I found this link which might help me do what I am looking for at: http://www.codeproject.com/Articles/309936/Csharp-NET-Network-File-System-NFS-Server But I cannot make it work.

I will appreciate very much if I can have a hello world example where I put the ip of the server on windows and it shows me a directory with the name hello world. I plan to run the server on a windows computer.

Also, it does not have to be a smb server. Any type of server that will enable me to browse for the files on windows.


Solution

  • From my experience, you can't connect to a SMB share outside of your local network. If you're trying to mount a SMB share, you'll have to use a VPN or other form of tunnel adapter to connect.

    But I'm a little confused by your question. Are you looking for example code for the SMB protocol or do you just want a SMB share? Look into something simple like Ubuntu with Samba. Samba is a really easy SMB share, but like I said before, it won't work over the Internet.