Click here to Skip to main content
15,915,172 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is this a pointer operation ? Pin
Andy Wieberneit30-Mar-04 11:09
Andy Wieberneit30-Mar-04 11:09 
AnswerRe: Is this a pointer operation ? Pin
Bryan White31-Mar-04 9:01
Bryan White31-Mar-04 9:01 
GeneralC# time to C++ time_t Pin
goodpilot30-Mar-04 8:22
goodpilot30-Mar-04 8:22 
GeneralRe: C# time to C++ time_t Pin
Heath Stewart30-Mar-04 9:31
protectorHeath Stewart30-Mar-04 9:31 
GeneralRe: C# time to C++ time_t Pin
goodpilot30-Mar-04 10:19
goodpilot30-Mar-04 10:19 
GeneralRe: C# time to C++ time_t Pin
Bryan White31-Mar-04 9:11
Bryan White31-Mar-04 9:11 
GeneralRe: C# time to C++ time_t Pin
Heath Stewart31-Mar-04 9:17
protectorHeath Stewart31-Mar-04 9:17 
GeneralWriting and closing files Pin
Member 70426330-Mar-04 7:32
Member 70426330-Mar-04 7:32 
Hi!

My code looks like this:

//----------------------------------------------------------------------------
input  = new FileStream(tempDirectory + "\\" + tempArchiv.Dateiname, <br />
                        FileMode.Open);<br />
output = new FileStream(sicherungsOrt + "\\" + tempArchiv.Dateiname, <br />
                        FileMode.Create, <br />
                        FileAccess.Write);<br />
reader = new BinaryReader(input);<br />
writer = new BinaryWriter(output);


//here I read from the reader and write it to the file with the writer
//...

//then I flush and close the input, output, reader and writer
input.Close();								<br />
reader.Close();<br />
<br />
writer.Flush();<br />
output.Flush();									<br />
								<br />
output.Close();								<br />
writer.Close();


//here I do other things, but I don't do anything with the files I wrote and read

//and then I try to delete the file I wrote, but it occurs an exception and I don't know why
System.IO.File.Delete(sicherungsOrt + "\\" + tempArchive.Dateiname)
//----------------------------------------------------------------------------

The Exception looks like this:

The process is not able to access the file, because an other process uses it.

What's wrong with my code?

thanks, Gerhard
GeneralRe: Writing and closing files Pin
leppie30-Mar-04 7:46
leppie30-Mar-04 7:46 
GeneralRe: Writing and closing files Pin
Member 70426330-Mar-04 7:53
Member 70426330-Mar-04 7:53 
GeneralRe: Writing and closing files Pin
Heath Stewart30-Mar-04 8:51
protectorHeath Stewart30-Mar-04 8:51 
GeneralMP3 Streaming sdk Pin
refahn30-Mar-04 7:32
refahn30-Mar-04 7:32 
GeneralJoint Collection Project Pin
Jonathan de Halleux30-Mar-04 7:13
Jonathan de Halleux30-Mar-04 7:13 
GeneralRe: Joint Collection Project Pin
leppie30-Mar-04 7:42
leppie30-Mar-04 7:42 
GeneralRe: Joint Collection Project Pin
Jonathan de Halleux30-Mar-04 7:48
Jonathan de Halleux30-Mar-04 7:48 
GeneralRe: Joint Collection Project Pin
leppie30-Mar-04 7:50
leppie30-Mar-04 7:50 
GeneralRe: Joint Collection Project Pin
Jonathan de Halleux30-Mar-04 7:54
Jonathan de Halleux30-Mar-04 7:54 
GeneralRe: Joint Collection Project Pin
Nemanja Trifunovic30-Mar-04 7:55
Nemanja Trifunovic30-Mar-04 7:55 
GeneralRe: Joint Collection Project Pin
Jonathan de Halleux30-Mar-04 8:00
Jonathan de Halleux30-Mar-04 8:00 
GeneralRe: Joint Collection Project Pin
Heath Stewart30-Mar-04 8:48
protectorHeath Stewart30-Mar-04 8:48 
GeneralRe: Joint Collection Project Pin
Jonathan de Halleux30-Mar-04 8:52
Jonathan de Halleux30-Mar-04 8:52 
GeneralRe: Joint Collection Project Pin
Heath Stewart30-Mar-04 8:54
protectorHeath Stewart30-Mar-04 8:54 
GeneralRe: Joint Collection Project Pin
Jonathan de Halleux30-Mar-04 8:57
Jonathan de Halleux30-Mar-04 8:57 
QuestionDynamic tooltip text using MouseOver event? Pin
LongRange.Shooter30-Mar-04 7:03
LongRange.Shooter30-Mar-04 7:03 
AnswerRe: Dynamic tooltip text using MouseOver event? Pin
Heath Stewart30-Mar-04 8:46
protectorHeath Stewart30-Mar-04 8:46 

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.