自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

C#操作文本文件之添加文本操作淺析

開發(fā) 后端
C#操作文本文件之添加文本操作是如何實(shí)現(xiàn)呢?C#操作文本文件之添加文本操作具體的實(shí)現(xiàn)是如何的呢?那么本文就向你介紹相關(guān)的內(nèi)容。

C#操作文本文件之添加文本操作是如何實(shí)現(xiàn)的呢?讓我們來(lái)看看具體的實(shí)例方式:

  1. using System;  
  2.  
  3. using System.IO;  
  4.  
  5. class Test   
  6.  
  7.  //C#操作文本文件之添加文本操作
  8. {  
  9.  
  10. public static void Main()   
  11.  
  12. {  
  13.  
  14. // Create an instance of StreamWriter to write text to a file.  
  15.  
  16. // The using statement also closes the StreamWriter.  
  17.  
  18. using (StreamWriter sw = new StreamWriter("TestFile.txt"))   
  19.  
  20. {  
  21.  
  22. // Add some text to the file.  
  23.  
  24. sw.Write("This is the ");  
  25.  
  26. sw.WriteLine("header for the file.");  
  27.  
  28. sw.WriteLine("-------------------");  
  29.  
  30. // Arbitrary objects can also be written to the file.  
  31.  
  32. sw.Write("The date is: ");  
  33.  
  34. sw.WriteLine(DateTime.Now);  
  35.  
  36. }  
  37.  //C#操作文本文件之添加文本操作
  38. }  
  39.  

C#操作文本文件之添加文本操作的基本情況就向你介紹到這里,希望對(duì)你了解和學(xué)習(xí)C#操作文本文件有所幫助。

【編輯推薦】

  1. C# 操作符之is應(yīng)用淺析
  2. C# 操作符之三元操作符淺析
  3. C# 操作符之 . 運(yùn)算符應(yīng)用詳解
  4. C# 操作符分類及應(yīng)用淺析
  5. C#操作文本文件實(shí)例淺析
責(zé)任編輯:仲衡 來(lái)源: CSDN博客
相關(guān)推薦

2009-08-19 17:44:15

C#操作文本文件

2009-08-20 10:17:27

C#操作文本文件

2009-08-20 09:26:14

C#操作文本文件

2009-08-20 09:58:06

C#操作文本文件

2009-09-02 19:13:08

C#處理文本文件

2009-09-02 19:08:03

C#實(shí)現(xiàn)讀取文本文件

2009-09-04 15:56:35

寫入文本文件

2010-01-11 17:05:32

VB.NET操作文本文

2009-08-06 18:33:45

C#處理文本文件

2009-08-26 11:53:56

C#打印文本文件

2009-10-29 14:16:32

VB.NET讀寫文本文

2009-08-12 17:59:48

C#讀取文本文

2009-11-02 11:22:59

VB.NET文本文件操

2010-04-30 17:38:31

Unix文本

2010-02-01 14:26:50

C++讀寫文本文件

2009-08-12 17:42:57

C#讀文本文件

2021-11-29 09:46:11

FileReaderJava開發(fā)

2009-08-18 16:20:09

C# 操作Excel

2009-08-18 16:14:05

C# 操作Excel

2009-08-20 10:25:37

C#操作內(nèi)存
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)