新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C#操作文本文件之添加文本操作淺析
C#操作文本文件之添加文本操作是如何實現(xiàn)的呢?讓我們來看看具體的實例方式:

漳縣網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)建站!從網(wǎng)頁設計、網(wǎng)站建設、微信開發(fā)、APP開發(fā)、成都響應式網(wǎng)站建設公司等網(wǎng)站項目制作,到程序開發(fā),運營維護。創(chuàng)新互聯(lián)建站成立與2013年到現(xiàn)在10年的時間,我們擁有了豐富的建站經驗和運維經驗,來保證我們的工作的順利進行。專注于網(wǎng)站建設就選創(chuàng)新互聯(lián)建站。
- using System;
- using System.IO;
- class Test
- //C#操作文本文件之添加文本操作
- {
- public static void Main()
- {
- // Create an instance of StreamWriter to write text to a file.
- // The using statement also closes the StreamWriter.
- using (StreamWriter sw = new StreamWriter("TestFile.txt"))
- {
- // Add some text to the file.
- sw.Write("This is the ");
- sw.WriteLine("header for the file.");
- sw.WriteLine("-------------------");
- // Arbitrary objects can also be written to the file.
- sw.Write("The date is: ");
- sw.WriteLine(DateTime.Now);
- }
- //C#操作文本文件之添加文本操作
- }
- }
C#操作文本文件之添加文本操作的基本情況就向你介紹到這里,希望對你了解和學習C#操作文本文件有所幫助。
本文標題:C#操作文本文件之添加文本操作淺析
標題URL:http://m.fisionsoft.com.cn/article/cdidisg.html


咨詢
建站咨詢
