Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
AnswerRe: ******** into the wind? Pin
BoneSoft16-Jun-06 10:29
BoneSoft16-Jun-06 10:29 
QuestionPanel_paint method Pin
reshsilk16-Jun-06 4:21
reshsilk16-Jun-06 4:21 
AnswerRe: Panel_paint method Pin
Josh Smith16-Jun-06 4:26
Josh Smith16-Jun-06 4:26 
GeneralRe: Panel_paint method Pin
Guffa16-Jun-06 5:00
Guffa16-Jun-06 5:00 
GeneralRe: Panel_paint method Pin
reshsilk16-Jun-06 5:08
reshsilk16-Jun-06 5:08 
Questiondatatype error datagridview Pin
adamoz16-Jun-06 4:17
adamoz16-Jun-06 4:17 
QuestionScreen Capture Image bit depth question.. [modified] Pin
Greg Ellis16-Jun-06 4:16
Greg Ellis16-Jun-06 4:16 
QuestionProblem opening and reading file [modified] Pin
jjvainav16-Jun-06 4:14
jjvainav16-Jun-06 4:14 
I am trying to read text from a file, however, I keep getting "The process cannot access the file ... because it is being used by another process."

The issue is, I know that another process has the file open, but I need to be able to read the file without closing that process.

The weird thing is, I can open and edit the text file with notepad, but all the methods I have tried thus far in C# keep throwing the access error.

Here is one of the ways I am trying to open the file:

<br />
<br />
FileStream	file;<br />
TextReader	reader;<br />
			<br />
try<br />
{<br />
      file = new FileStream("C:\\file.log", FileMode.Open, FileAccess.Read, FileShare.Read);<br />
      reader = new StreamReader(file);<br />
				<br />
      string test = reader.ReadLine();<br />
				<br />
      MessageBox.Show(test);<br />
}<br />
catch(Exception ex)<br />
{<br />
      MessageBox.Show(ex.ToString());<br />
}<br />
<br />


-- modified at 11:55 Friday 16th June, 2006
AnswerRe: Problem openning and reading file Pin
Chikuu16-Jun-06 5:05
Chikuu16-Jun-06 5:05 
GeneralRe: Problem openning and reading file Pin
jjvainav16-Jun-06 5:55
jjvainav16-Jun-06 5:55 
GeneralRe: Problem openning and reading file Pin
Rizwan Majeed16-Jun-06 6:41
professionalRizwan Majeed16-Jun-06 6:41 
AnswerRe: Problem opening and reading file Pin
BoneSoft16-Jun-06 10:39
BoneSoft16-Jun-06 10:39 
QuestionCreation of Wizard to generate C# files Pin
tom groezer16-Jun-06 3:56
tom groezer16-Jun-06 3:56 
QuestionHow to show files in listView Pin
akualopetak16-Jun-06 3:13
akualopetak16-Jun-06 3:13 
AnswerRe: How to show files in listView Pin
Robert Rohde16-Jun-06 3:51
Robert Rohde16-Jun-06 3:51 
Questionproblem with Tab Key & Mouse click Pin
maaran16-Jun-06 2:39
maaran16-Jun-06 2:39 
AnswerRe: problem with Tab Key & Mouse click Pin
aarthi@yahoo.com16-Jun-06 3:08
aarthi@yahoo.com16-Jun-06 3:08 
QuestionUrgent Pin
Shiv516-Jun-06 2:33
Shiv516-Jun-06 2:33 
AnswerRe: Urgent Pin
J4amieC16-Jun-06 3:18
J4amieC16-Jun-06 3:18 
QuestionReading Excel to Dataset Pin
meeram39516-Jun-06 2:09
meeram39516-Jun-06 2:09 
AnswerRe: Reading Excel to Dataset Pin
Eric Dahlvang16-Jun-06 3:16
Eric Dahlvang16-Jun-06 3:16 
GeneralRe: Reading Excel to Dataset Pin
meeram39516-Jun-06 4:37
meeram39516-Jun-06 4:37 
GeneralRe: Reading Excel to Dataset Pin
Eric Dahlvang16-Jun-06 10:01
Eric Dahlvang16-Jun-06 10:01 
QuestionDataGridView scrolling problem Pin
florinp316-Jun-06 2:06
florinp316-Jun-06 2:06 
QuestionDataGridView scrolling problem - details [modified] Pin
florinp320-Jun-06 21:27
florinp320-Jun-06 21:27 

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.