Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: DirListBox and Root Pin
swjam9-Aug-07 18:17
swjam9-Aug-07 18:17 
GeneralRe: DirListBox and Root Pin
Michael Sync9-Aug-07 19:52
Michael Sync9-Aug-07 19:52 
GeneralRe: DirListBox and Root Pin
Judah Gabriel Himango9-Aug-07 18:08
sponsorJudah Gabriel Himango9-Aug-07 18:08 
Questionhelp me out with this.. urgent!! Pin
chumairr9-Aug-07 15:41
chumairr9-Aug-07 15:41 
AnswerRe: help me out with this.. urgent!! Pin
Luc Pattyn9-Aug-07 16:14
sitebuilderLuc Pattyn9-Aug-07 16:14 
AnswerWell let me drop everything and run to the rescue... Pin
leckey10-Aug-07 3:03
leckey10-Aug-07 3:03 
QuestionFile access is denied Pin
rkcsharp9-Aug-07 15:37
rkcsharp9-Aug-07 15:37 
AnswerRe: File access is denied Pin
Guffa9-Aug-07 15:53
Guffa9-Aug-07 15:53 
Are you closing the file properly?

If you leave the file open, it will eventually get closed when the stream object is finalized by the garbage collector. This may happen at any time, and would typically show the behaviour that you are experiencing.

Preferably you would use a using block to make sure that the file is always closed properly. Example:

using (StreamWriter writer = File.CreateText(@"c:\test.txt")) {
   writer.WriteLine("Hello world.");
}


The StreamWriter (and the underlying FileStream) will automatically be closed and disposed at the closing }.

---
single minded; short sighted; long gone;

GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 16:15
rkcsharp9-Aug-07 16:15 
AnswerRe: File access is denied Pin
Luc Pattyn9-Aug-07 16:16
sitebuilderLuc Pattyn9-Aug-07 16:16 
GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 16:28
rkcsharp9-Aug-07 16:28 
AnswerRe: File access is denied Pin
rkcsharp9-Aug-07 16:33
rkcsharp9-Aug-07 16:33 
AnswerRe: File access is denied Pin
Guffa9-Aug-07 17:10
Guffa9-Aug-07 17:10 
GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 17:19
rkcsharp9-Aug-07 17:19 
AnswerRe: File access is denied Pin
Guffa9-Aug-07 18:10
Guffa9-Aug-07 18:10 
GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 18:33
rkcsharp9-Aug-07 18:33 
AnswerRe: File access is denied Pin
Nouman Bhatti9-Aug-07 19:55
Nouman Bhatti9-Aug-07 19:55 
GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 21:30
rkcsharp9-Aug-07 21:30 
AnswerRe: File access is denied Pin
Albu Marius9-Aug-07 20:27
Albu Marius9-Aug-07 20:27 
GeneralRe: File access is denied Pin
rkcsharp9-Aug-07 21:33
rkcsharp9-Aug-07 21:33 
QuestionXNA Curve Class Pin
Mike Ellison9-Aug-07 14:51
Mike Ellison9-Aug-07 14:51 
AnswerRe: XNA Curve Class Pin
Judah Gabriel Himango9-Aug-07 15:35
sponsorJudah Gabriel Himango9-Aug-07 15:35 
GeneralRe: XNA Curve Class Pin
Mike Ellison10-Aug-07 6:16
Mike Ellison10-Aug-07 6:16 
GeneralRe: XNA Curve Class Pin
Judah Gabriel Himango10-Aug-07 6:25
sponsorJudah Gabriel Himango10-Aug-07 6:25 
GeneralRe: XNA Curve Class Pin
Mike Ellison10-Aug-07 6:34
Mike Ellison10-Aug-07 6:34 

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.