Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to find the best way to create and manage a shared log over a network in VB.net.

Users on different PCs must be able to change checkboxes related to the status of files within a folder and all users must see all changes.

In other words, say 5 people on different PCs all have their applications looking into the same folder. If one individual decides to mark a file as checked, then this will immediately be visible to others (and vice versa).

I'm sorry if my explanation isn't ideal but if anyone can offer any suggestions I'd be very grateful.

Many thanks.
Posted

1 solution

What has this to do with logs/logging? Anyway, the simplest method of sharing such data is using a database engine. Not necessary a heavy one like SQL Server - Firebird would do it, aspecially as it implements event model, so you can notify users about changes. An other approach woud be using share folder (i mean SAMBA, windows sharing) and using FileSystemWatcher[^] in the clients to monitor the same folder. This won't work if the clients are in totally different networks.
 
Share this answer
 
Comments
codetowns 30-Jan-15 9:01am    
Thanks Zoltan. Apologies if 'logging' isn't the word - I am pretty much self taught so have a few gaps in my knowledge!

Yes, I have file sharing already setup and I have implemented FileSystemWatcher to flag file changes. I'm really only after a very basic method and am loath to go down the database route at the moment.

I had a basic implementation of this working by creating/deleting 'check' files in the shared folder. The problem is it produces file sharing exceptions from time to time.

Is there a way around file sharing exceptions in a Windows network?
Zoltán Zörgő 30-Jan-15 14:07pm    
Well, it is not easy to work with shared resources concurrently. The only good approach here is to keep handles open as short as possible, and do a delayed retry on such exceptions. It is an accepted model. Still, if you have a shared folder somewhere, you could use the same server to implement all this in a database, which handles locking and other nifty things. So it is a much better approach. I suggest you try to switch to this approach. It is cleaner, and easier. As I mentioned before Firebird would be a good choice as it has an EVENT model defined, so there is no need to poll for changes, as firing event will notify all clinet registered for that event.
codetowns 1-Feb-15 6:07am    
Yes, delayed retry on exception is a good idea. I would go the database route if the shared folder was always on one server but it isn't so I guess I would have to install it on all machines for this to work. Anyway many thanks Zoltán.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900