Solved

Logging information to a Text file from multiple process

Posted on 2009-04-10
3
257 Views
Last Modified: 2013-11-26
Is it possible to write to a text file accross process in VB.Net ? How to make it thread safe?
I have aprocess A, Process B and C all writing information to a centralized text file. I tried to use the Lock() and UnLock(). But when Process A locks it, when process B tries to write, I Get exception that other process is using the file. Is there a way to wait till the lock is released and write to the text file.

Any help would be appreciated
0
Comment
Question by:nvenkata
[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
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Nirmalan Nagenthiran
ID: 24121432
0
 
LVL 12

Accepted Solution

by:
Nirmalan Nagenthiran earned 500 total points
ID: 24121437
Sorry the code provided in the article is C#, but still you get some idea.
0
 

Author Closing Comment

by:nvenkata
ID: 31569060
Thanks for the pointer. It really helps
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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