Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
AnswerRe: Log File Permissions Pin
Big Daddy Farang5-Apr-12 10:26
Big Daddy Farang5-Apr-12 10:26 
AnswerRe: Log File Permissions Pin
RobCroll5-Apr-12 11:33
RobCroll5-Apr-12 11:33 
GeneralRe: Log File Permissions Pin
Steve Harp6-Apr-12 6:10
Steve Harp6-Apr-12 6:10 
QuestionUser control not updating when running project Pin
TheFoZ5-Apr-12 4:23
TheFoZ5-Apr-12 4:23 
AnswerRe: User control not updating when running project Pin
Eddy Vluggen5-Apr-12 6:31
professionalEddy Vluggen5-Apr-12 6:31 
SuggestionRe: User control not updating when running project Pin
RobCroll5-Apr-12 11:50
RobCroll5-Apr-12 11:50 
AnswerRe: User control not updating when running project Pin
TheFoZ9-Apr-12 21:34
TheFoZ9-Apr-12 21:34 
QuestionUser Shared File Access Pin
PapaGeek5-Apr-12 4:10
PapaGeek5-Apr-12 4:10 
I’m using Visual Studio 2010 on Windows 7

I’m trying to write a log file in one program while reading the same log file in a second program.

The first program receives data from a server every minute from second 0 through second 5.

I want the second program to sleep till 30 seconds after each minute, read the traces from the first program’s log file, and display any warnings.

I found a post on the web saying I should open the file in program 1 as:

_logStream = new FileStream(logFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
_logFile = new StreamWriter(_logStream);


Then open the file in program 2 as:



var _logStream = new FileStream(filename1, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var xyz = new StreamReader(_logStream);

But I get the error message:

Unhandled Exception: System.IO.IOException: The process cannot access the file '
C:\SandBox\120405133716.log' because it is being used by another process.

Can this be done in Window's 7 ??
If so, what is the proper code ??
AnswerRe: User Shared File Access Pin
Eddy Vluggen5-Apr-12 6:05
professionalEddy Vluggen5-Apr-12 6:05 
Questionvisiual programing Pin
Arikod Augustine5-Apr-12 3:36
Arikod Augustine5-Apr-12 3:36 
AnswerRe: visiual programing Pin
Dave Kreskowiak5-Apr-12 3:53
mveDave Kreskowiak5-Apr-12 3:53 
AnswerRe: visiual programing Pin
Richard Andrew x645-Apr-12 7:52
professionalRichard Andrew x645-Apr-12 7:52 
GeneralRe: visiual programing Pin
OriginalGriff5-Apr-12 19:54
mveOriginalGriff5-Apr-12 19:54 
QuestionRe: visiual programing Pin
ZurdoDev5-Apr-12 5:35
professionalZurdoDev5-Apr-12 5:35 
AnswerRe: visiual programing Pin
V.5-Apr-12 20:43
professionalV.5-Apr-12 20:43 
AnswerRe: visiual programing Pin
Alan Balkany10-Apr-12 4:40
Alan Balkany10-Apr-12 4:40 
Questionclose winforms childs and main Pin
Ronenb5-Apr-12 2:45
Ronenb5-Apr-12 2:45 
AnswerRe: close winforms childs and main Pin
Eddy Vluggen5-Apr-12 2:53
professionalEddy Vluggen5-Apr-12 2:53 
GeneralRe: close winforms childs and main Pin
Ronenb5-Apr-12 4:54
Ronenb5-Apr-12 4:54 
AnswerRe: close winforms childs and main Pin
Eddy Vluggen5-Apr-12 6:01
professionalEddy Vluggen5-Apr-12 6:01 
GeneralRe: close winforms childs and main Pin
Ronenb5-Apr-12 7:44
Ronenb5-Apr-12 7:44 
AnswerRe: close winforms childs and main Pin
Eddy Vluggen5-Apr-12 8:16
professionalEddy Vluggen5-Apr-12 8:16 
GeneralRe: close winforms childs and main Pin
Big Daddy Farang5-Apr-12 9:15
Big Daddy Farang5-Apr-12 9:15 
Suggestiontreeview binding Pin
abhinavashubajpai5-Apr-12 0:44
abhinavashubajpai5-Apr-12 0:44 
GeneralRe: treeview binding Pin
Pete O'Hanlon5-Apr-12 0:48
mvePete O'Hanlon5-Apr-12 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.