csharp append text to file

Code Example - csharp append text to file

                
                        File.AppendAllText(@"c:\path\file.txt", "text content" + Environment.NewLine);
                    
                
 

csharp append to file

                        
                                File.AppendAllText(@"c:\path\file.txt", "text content" + Environment.NewLine);
                            
                        
 

streamwriter append text

                        
                                using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.Write))
 using (StreamWriter sw = new StreamWriter(fs))
 {
    sw.WriteLine(something);
 }