소리소문 없이... 사랑도 명예도 이름도 남김 없이...
DexCore.net

C#

File Read & Write

탑~! 2013. 3. 27. 11:25

using System.IO;
using System.Xml;


string strSaveFilePath = "C:\\Save.txt"; // 파일의 경로입니다.

StreamReader SRead = new StreamReader(strSaveFilePath, System.Text.Encoding.UTF8);

string strFileLine = string.Empty;
while((strFileLine = SRead.ReadLine()) != null)
{
Console.WriteLine(strFileLine); // 읽어온 문자열을 뿌립니다.
}

SRead.Close();



string strTest = "File 쓰기 TEST~!!";
StreamWriter SWrite = new StreamWriter(strSaveFilePath,false,System.Text.Encoding.UTF8);

SWrite.WriteLine(strTest);
SWrite.Close();


728x90
반응형

'C#' 카테고리의 다른 글

Binary File Read & Write  (0) 2013.03.27
StopWatch  (0) 2013.03.27
Base64 인코딩, 디코딩 클래스  (0) 2013.01.17
DirectX 를 사용하여 ScreenCapture 하기  (0) 2013.01.17
.Net Zip Library  (0) 2013.01.17