Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
Questionto center TabPage Scroll Bar [modified] Pin
fatihbilmuh27-Jul-07 11:59
fatihbilmuh27-Jul-07 11:59 
QuestionI need practical ideas for IT engineering Graduation Project Pin
michaelqog27-Jul-07 11:00
michaelqog27-Jul-07 11:00 
AnswerRe: I need practical ideas for IT engineering Graduation Project Pin
snorkie27-Jul-07 11:09
professionalsnorkie27-Jul-07 11:09 
AnswerRe: I need practical ideas for IT engineering Graduation Project Pin
Paul Conrad28-Jul-07 11:24
professionalPaul Conrad28-Jul-07 11:24 
QuestionHow can I edit a database row and then update it ? Pin
eni_9427-Jul-07 10:43
eni_9427-Jul-07 10:43 
QuestionWindows Forms Messages Problem Pin
gopher_uk27-Jul-07 9:57
gopher_uk27-Jul-07 9:57 
AnswerRe: Windows Forms Messages Problem Pin
User 665829-Jul-07 7:14
User 665829-Jul-07 7:14 
QuestionFile Streamer Problems Pin
ytubis27-Jul-07 9:44
ytubis27-Jul-07 9:44 
Hi!
I am using to read and write to a specific file.
In The beginig i am doing this:

if (File.Exists("Delete_Items.txt"))
{
bfs = new FileStream("Delete_Items.txt", FileMode.Open);
StreamReader m_streamReader = new StreamReader(bfs);
textBox2.Text = m_streamReader.ReadLine();
m_streamReader.Close();
bfs.Close();
}

So i am reading from the file and then free every thing, but then i am tring to do ub another function this:

FileStream bfs = null;
if (File.Exists("Delete_Items.txt"))
{
File.Delete("Delete_Items.txt");
File.Create("Delete_Items.txt");
bfs = new FileStream("Delete_Items.txt", FileMode.Append);
StreamWriter m_streamWriter = new StreamWriter(bfs);
m_streamWriter.WriteLine(textBox2.Text);
m_streamWriter.Close();
bfs.Close();
}

I want to overrite the data and so i am deleting the file before, and i get an exception explainig me that the file is being used by another process, and this is although i freed it.

What is wrong??

Thanks Smile | :)
AnswerRe: File Streamer Problems Pin
BoneSoft27-Jul-07 9:55
BoneSoft27-Jul-07 9:55 
AnswerRe: File Streamer Problems Pin
Luc Pattyn27-Jul-07 9:59
sitebuilderLuc Pattyn27-Jul-07 9:59 
AnswerRe: File Streamer Problems Pin
snorkie27-Jul-07 10:01
professionalsnorkie27-Jul-07 10:01 
AnswerRe: File Streamer Problems Pin
PhilDanger27-Jul-07 10:34
PhilDanger27-Jul-07 10:34 
QuestionPerformance difference?? Pin
Shy Agam27-Jul-07 9:42
Shy Agam27-Jul-07 9:42 
AnswerRe: Performance difference?? Pin
BoneSoft27-Jul-07 9:52
BoneSoft27-Jul-07 9:52 
AnswerRe: Performance difference?? Pin
Shy Agam27-Jul-07 10:02
Shy Agam27-Jul-07 10:02 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:10
sitebuilderLuc Pattyn27-Jul-07 10:10 
GeneralRe: Performance difference?? Pin
Shy Agam27-Jul-07 10:13
Shy Agam27-Jul-07 10:13 
AnswerRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:06
sitebuilderLuc Pattyn27-Jul-07 10:06 
GeneralRe: Performance difference?? Pin
BoneSoft27-Jul-07 10:29
BoneSoft27-Jul-07 10:29 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:46
sitebuilderLuc Pattyn27-Jul-07 10:46 
AnswerRe: Performance difference?? Pin
Paul Conrad27-Jul-07 10:07
professionalPaul Conrad27-Jul-07 10:07 
AnswerRe: Performance difference?? Pin
snorkie27-Jul-07 10:51
professionalsnorkie27-Jul-07 10:51 
GeneralRe: Performance difference?? Pin
PIEBALDconsult27-Jul-07 13:38
mvePIEBALDconsult27-Jul-07 13:38 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 14:57
sitebuilderLuc Pattyn27-Jul-07 14:57 
AnswerMessage formatting question (expires on sunday) Pin
Luc Pattyn27-Jul-07 23:36
sitebuilderLuc Pattyn27-Jul-07 23:36 

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.