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

漳縣網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)建站!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)公司等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。創(chuàng)新互聯(lián)建站成立與2013年到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(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#操作文本文件之添加文本操作的基本情況就向你介紹到這里,希望對(duì)你了解和學(xué)習(xí)C#操作文本文件有所幫助。
網(wǎng)站題目:C#操作文本文件之添加文本操作淺析
網(wǎng)站路徑:http://www.5511xx.com/article/cdidisg.html


咨詢
建站咨詢
