Click here to Skip to main content
15,561,125 members
Home / Discussions / C#
   

C#

 
GeneralRe: Desktop Calender Repost Pin
WinSolution1-Mar-09 3:32
WinSolution1-Mar-09 3:32 
GeneralRe: Desktop Calender Repost Pin
0x3c01-Mar-09 7:27
0x3c01-Mar-09 7:27 
AnswerRe: Desktop Calender Repost Pin
AKNR Chandra Sekhar19-Mar-09 9:47
AKNR Chandra Sekhar19-Mar-09 9:47 
QuestionSaving User and Application Settings in WinForms Pin
Sokka9328-Feb-09 22:29
Sokka9328-Feb-09 22:29 
AnswerRe: Saving User and Application Settings in WinForms Pin
ABitSmart1-Mar-09 1:30
ABitSmart1-Mar-09 1:30 
GeneralRe: Saving User and Application Settings in WinForms Pin
Sokka931-Mar-09 1:54
Sokka931-Mar-09 1:54 
AnswerRe: Saving User and Application Settings in WinForms Pin
Henry Minute1-Mar-09 2:23
Henry Minute1-Mar-09 2:23 
QuestionFile Not Found Exception Handling Pin
Lim Yuxuan28-Feb-09 22:29
Lim Yuxuan28-Feb-09 22:29 
Hi I am trying to handle a file not found exception by creating the specified text file if it does not exists.

void RetrieveData()
{
if(File.Exists("books.txt") == false) // if file doesnt exists
{
File.Create("books.txt"); // create the file
}
//Create a stream reader object to read from "books.txt"
StreamReader DataReader = new StreamReader("books.txt");
}

I did a test run and remove the books.txt file from the current working directory on purpose and when i start debugging all I get is this exception :

The process cannot access the file 'C:\Documents and Settings\Administrator\My Documents\NYP Work\C#\MiniProject 2009\PhotoAlbum_V2\bin\Debug\books.txt' because it is being used by another process.

Any suggested solutions ?
AnswerRe: File Not Found Exception Handling Pin
0x3c01-Mar-09 0:16
0x3c01-Mar-09 0:16 
GeneralRe: File Not Found Exception Handling Pin
Lim Yuxuan1-Mar-09 2:27
Lim Yuxuan1-Mar-09 2:27 
Questionbuilding network in form of a graph Pin
sunnyk8628-Feb-09 21:52
sunnyk8628-Feb-09 21:52 
AnswerRe: building network in form of a graph Pin
Yusuf28-Feb-09 22:16
Yusuf28-Feb-09 22:16 
AnswerRe: building network in form of a graph Pin
Eytukan1-Mar-09 3:41
Eytukan1-Mar-09 3:41 
Questiontoolbar moving Pin
shefa' isied28-Feb-09 21:42
shefa' isied28-Feb-09 21:42 
AnswerRe: toolbar moving Pin
Yusuf28-Feb-09 22:17
Yusuf28-Feb-09 22:17 
QuestionSocket Pin
mrithula828-Feb-09 21:39
mrithula828-Feb-09 21:39 
AnswerRe: Socket Pin
Yusuf28-Feb-09 22:22
Yusuf28-Feb-09 22:22 
GeneralRe: Socket Pin
mrithula828-Feb-09 23:47
mrithula828-Feb-09 23:47 
GeneralRe: Socket Pin
0x3c01-Mar-09 0:23
0x3c01-Mar-09 0:23 
GeneralRe: Socket Pin
mrithula81-Mar-09 0:39
mrithula81-Mar-09 0:39 
GeneralRe: Socket Pin
0x3c01-Mar-09 0:54
0x3c01-Mar-09 0:54 
GeneralRe: Socket Pin
mrithula81-Mar-09 18:22
mrithula81-Mar-09 18:22 
GeneralRe: Socket Pin
mrithula81-Mar-09 19:48
mrithula81-Mar-09 19:48 
QuestionHow to Copy Form in Project ? Pin
E_Gold28-Feb-09 21:12
E_Gold28-Feb-09 21:12 
AnswerRe: How to Copy Form in Project ? Pin
Yusuf28-Feb-09 22:26
Yusuf28-Feb-09 22:26 

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.