Results 1 to 6 of 6

Thread: virtual Folders/Files/Partions Sharing

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2009
    Posts
    40

    virtual Folders/Files/Partions Sharing

    hello every one
    i'm working in LAN Program that has some features like In-LAN Chatting and Sharing Files and folder

    the problem now that :
    some PCs doesn't has Share because(OS Missing Files / he has no permissions for sharing / sharing is disabled by PC Administrator / or Network Privilege )

    so i need to make some thing like virtual sharing it is not Share option that in Windows
    but some think that make the two that have my application can sharing specified Folder/Files through my application only not in real Shared folders


    in another way it is look like Virtual explorer or FTP , so the owner can specify permission for each folder (who can see , Copy , Edit ..... etc.)
    any one have ideas for some thing like that

    BTW : my program is in VB. Net 2010 (No problem if it can solved via C#)
    and using .Net Socket

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: virtual Folders/Files/Partions Sharing

    You're going to have to create a store on each client, whether that be a real folder or isolated storage or whatever. When two clients connect, each one will have to read the data from its own store and transmit the information to the other client in a suitable form that it can read. It's not something that we can demonstrate in a few lines of code. You have many decisions to make and components to design, e.g. where will the data be stored on each client and what will the protocol be for communication. You need to sit down and do some design work before you start writing any code. You would also make sure that each client can efficiently read all its own data before trying to transmit anything to another client.

    As for how to do the transmission, you'd probably want to look at the TcpListener and TcpClient first of all. Only resort to using a Socket directly if the TcpClient can't handle what you need to do.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2009
    Posts
    40

    Re: virtual Folders/Files/Partions Sharing

    Quote Originally Posted by jmcilhinney View Post
    You're going to have to create a store on each client, whether that be a real folder or isolated storage or whatever.
    you mean for Exambel Client1 want to share Folder "D:\test" so copy it to the store folder or just Put short cut ??
    Quote Originally Posted by jmcilhinney View Post
    When two clients connect, each one will have to read the data from its own store and transmit the information to the other client in a suitable form that it can read. It's not something that we can demonstrate in a few lines of code. You have many decisions to make and components to design, e.g. where will the data be stored on each client and what will the protocol be for communication. You need to sit down and do some design work before you start writing any code. You would also make sure that each client can efficiently read all its own data before trying to transmit anything to another client.
    yes that is the most complicated part , i was thinking of making it some thing with Web Browser (and view remote folders as Ftps or Dirs )
    or make it with TreeView and ListView

    Quote Originally Posted by jmcilhinney View Post
    As for how to do the transmission, you'd probably want to look at the TcpListener and TcpClient first of all. Only resort to using a Socket directly if the TcpClient can't handle what you need to do.
    yea i don't like TPCListner as i was used to work with VB6 and WinSocket Control ,
    i will search more on System.Net.Sockets.Socket i think it will be more compatible

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: virtual Folders/Files/Partions Sharing

    Quote Originally Posted by elragal_30 View Post
    you mean for Exambel Client1 want to share Folder "D:\test" so copy it to the store folder or just Put short cut ??
    No, if you want to share a physical folder then that physical folder is the store. The remote client can't see that store though, so the local server needs to describe it. I mean that the remote client can't look at the folder and see the subfolders and files it contains so the local server needs to tell the remote client about the folder and file structure and, when the remote client wants to open a file, it's actually the local server that opens the file and then sends the data.
    Quote Originally Posted by elragal_30 View Post
    yes that is the most complicated part , i was thinking of making it some thing with Web Browser (and view remote folders as Ftps or Dirs )
    or make it with TreeView and ListView
    Creating a UI much like Windows Explorer, i.e. with a TreeView and ListView, seems the most logical but there would be other options that would work as well. You can't send a TreeView and ListView between clients though. The server needs to read the store, be that a physical folder or something else, and create a description of it as efficiently as possible to send to the client. The client then interprets that description and populates its TreeView and ListView accordingly to represent the remote store to the user.
    Quote Originally Posted by elragal_30 View Post
    yea i don't like TPCListner as i was used to work with VB6 and WinSocket Control ,
    i will search more on System.Net.Sockets.Socket i think it will be more compatible
    You seem to be under some misconceptions. The Socket class cannot be more compatible than the TcpListener and TcpClient because they use Sockets anyway. In fact, at the server end, you would usually use the TcpListener.AcceptSocket method to create a Socket in the first place. It's preferable to use TcpListener.AcceptTcpClient to create a TcpClient though, because the TcpClient is easier to work with. A TcpClient is just a wrapper for a Socket with a simplified interface so you're still using a Socket anyway. You would only use a Socket directly if the simplified interface of the TcpClient can't handle what you need to do.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2009
    Posts
    40

    Re: virtual Folders/Files/Partions Sharing

    you mean that I need to get some thing like the shared folder/partition Map/Index and send them to Client , then if he need some File Server will send it
    and then in client convert this Map to Items to put in treeview/ListView
    but you mention that there are other options , can you tell me if there are more easier/flexible ??

    Important Question :
    in the above case when i send File from Server to Client , Is Speed will work as Internet Upload Speed(for server) / Internet Download Speed (for Client) ???
    eX:
    Client has 100 kbps Download speed from internet /Server has 50 kbps Upload speed to internet
    will it be same speed in my application (although the both on same network ) ??

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: virtual Folders/Files/Partions Sharing

    Quote Originally Posted by elragal_30 View Post
    you mean that I need to get some thing like the shared folder/partition Map/Index and send them to Client , then if he need some File Server will send it
    and then in client convert this Map to Items to put in treeview/ListView
    That's pretty much it and how you choose to do that is up to you.
    Quote Originally Posted by elragal_30 View Post
    but you mention that there are other options , can you tell me if there are more easier/flexible ??
    I'd think that using a physical folder would be the easiest and, if you want to simulate sharing a physical folder, also the most appropriate. If you were to use Isolated Storage or something like that then the store would not be visible to others so much as a physical folder is. Again, whatever is most appropriate for your scenario.
    Quote Originally Posted by elragal_30 View Post
    Important Question :
    in the above case when i send File from Server to Client , Is Speed will work as Internet Upload Speed(for server) / Internet Download Speed (for Client) ???
    eX:
    Client has 100 kbps Download speed from internet /Server has 50 kbps Upload speed to internet
    will it be same speed in my application (although the both on same network ) ??
    The data will be transmitted at the speed of the physical connection. If the clients are connected over the internet then you'll get internet speeds but if they're on the same LAN then you'll get LAN speeds.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width