Click here to Skip to main content
15,916,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: Empty strings with string.split Pin
Eddy Vluggen3-Nov-09 2:42
professionalEddy Vluggen3-Nov-09 2:42 
AnswerRe: Empty strings with string.split Pin
Alan N1-Nov-09 6:35
Alan N1-Nov-09 6:35 
AnswerRe: Empty strings with string.split Pin
PIEBALDconsult1-Nov-09 16:29
mvePIEBALDconsult1-Nov-09 16:29 
Questionwhat is application configuration file? Pin
Chesnokov Yuriy1-Nov-09 5:42
professionalChesnokov Yuriy1-Nov-09 5:42 
AnswerRe: what is application configuration file? Pin
PIEBALDconsult1-Nov-09 16:52
mvePIEBALDconsult1-Nov-09 16:52 
QuestionCannot access file error Pin
g3ng1-Nov-09 4:31
g3ng1-Nov-09 4:31 
AnswerRe: Cannot access file error Pin
Abhishek Sur1-Nov-09 4:45
professionalAbhishek Sur1-Nov-09 4:45 
AnswerRe: Cannot access file error Pin
OriginalGriff1-Nov-09 4:48
mveOriginalGriff1-Nov-09 4:48 
First, find what process is using the file. My best guess: it is your program.
Inside the try...catch block, add a using block:
try
   {
   using (outFileStream = new FileStream(outputFile, FileMode.Create))
      {
      ...handle your file here...
      }
   }
catch (Exception ex)
   {
MessageBox.Show(ex.ToString());
   }

What this does is ensure that the open file is fully closed and disposed before your app tries to open it again.
You may also want to replace the file mode with FileMode.OpenOrCreate

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: Cannot access file error Pin
g3ng2-Nov-09 5:34
g3ng2-Nov-09 5:34 
GeneralRe: Cannot access file error Pin
OriginalGriff2-Nov-09 5:41
mveOriginalGriff2-Nov-09 5:41 
GeneralRe: Cannot access file error Pin
g3ng2-Nov-09 6:03
g3ng2-Nov-09 6:03 
GeneralRe: Cannot access file error Pin
OriginalGriff2-Nov-09 6:17
mveOriginalGriff2-Nov-09 6:17 
GeneralRe: Cannot access file error Pin
g3ng2-Nov-09 7:14
g3ng2-Nov-09 7:14 
AnswerRe: Cannot access file error Pin
g3ng1-Nov-09 5:17
g3ng1-Nov-09 5:17 
Questioncan not read data when Install VS2008 program on windows XP [modified] Pin
obarahmeh1-Nov-09 1:31
obarahmeh1-Nov-09 1:31 
AnswerRe: can not read data when Install VS2008 program on windows XP Pin
OriginalGriff1-Nov-09 4:49
mveOriginalGriff1-Nov-09 4:49 
GeneralRe: can not read data when Install VS2008 program on windows XP Pin
obarahmeh1-Nov-09 19:10
obarahmeh1-Nov-09 19:10 
QuestionTcpListener EndWrite() method, how to wait until client will recieve all data before closing it? [modified] Pin
Chesnokov Yuriy31-Oct-09 23:40
professionalChesnokov Yuriy31-Oct-09 23:40 
QuestionRe: TcpListener EndWrite() method, how to wait until client will recieve all data before closing it? Pin
Chesnokov Yuriy31-Oct-09 23:50
professionalChesnokov Yuriy31-Oct-09 23:50 
QuestionDirectX DirectInput simulating Keyboard Pin
chainerlt31-Oct-09 23:14
chainerlt31-Oct-09 23:14 
AnswerRe: DirectX DirectInput simulating Keyboard Pin
Randor 1-Nov-09 4:19
professional Randor 1-Nov-09 4:19 
GeneralRe: DirectX DirectInput simulating Keyboard Pin
chainerlt1-Nov-09 10:56
chainerlt1-Nov-09 10:56 
GeneralRe: DirectX DirectInput simulating Keyboard Pin
Randor 1-Nov-09 11:04
professional Randor 1-Nov-09 11:04 
GeneralRe: DirectX DirectInput simulating Keyboard Pin
chainerlt1-Nov-09 13:41
chainerlt1-Nov-09 13:41 
GeneralRe: DirectX DirectInput simulating Keyboard Pin
Randor 1-Nov-09 23:11
professional Randor 1-Nov-09 23:11 

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.