---
title: "How to open file in append mode in c#"  
description: "How to open file in append mode in c#"  
author: "Anupam Mishra"  
published: 2016-01-22  
updated: 2016-01-22  
canonical: https://www.mindstick.com/forum/33911/how-to-open-file-in-append-mode-in-c-sharp  
category: "c#"  
tags: ["c#", ".net"]  
reading_time: 1 minute  

---

# How to open file in append mode in c#

Hi Everyone,I want to create a [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) "**Test.txt**" and it will open in append mode.I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) many times but it is overwrite the [previous](https://yourviews.mindstick.com/view/81421/unlock-2-0-is-just-like-previous-corona-lockdowns) [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) .So, please give me a solution. thank you.

## Replies

### Reply by Anupam Mishra

For create a file in append mode ,we need to use this constructor.

> ```
> StreamWriter file = new  StreamWriter(".../Text.txt", bool append);    file.WriteLine("your text");
> ```

if file are exist in specified path otherwise it will created a new one as well as it will start write in append mode(if bool append is true otherwise file will be override ).\
\


---

Original Source: https://www.mindstick.com/forum/33911/how-to-open-file-in-append-mode-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
