FileStream stmRecords = new FileStream(@"C:\Scanned.txt", FileMode.Append, FileAccess.Write, FileShare.None);
StreamWriter stmWriter = new StreamWriter(stmRecords);

stmWriter.WriteLine(var1 + " , " + var2);

stmWriter.Flush();
stmWriter.Close();


tnx for ur reply but this is what i searched. it's kinda easy to understand.
except the stmWriter.Flush(); i don't jknow its function.
but if someone has the same problem above code will do.