*파일 쓰기
string codes = "ABC";
FileInfo file = new FileInfo(saveFileDialog1.FileName);
FileStream fs = file.Create();
TextWriter tw = new StreamWriter(fs, Encoding.UTF8);
tw.Write(codes);
tw.Close();
fs.Close();
*파일 읽기
FileInfo file = new FileInfo(openFileDialog1.FileName);
TextReader tr = file.OpenText();
string codes = tr.ReadToEnd();
tr.Close();
MessageBox.Show(codes);
'프로그램 경험 > .Net' 카테고리의 다른 글
[ASP.NET] 웹서비스 경로 변경 (0) | 2013.03.06 |
---|---|
[ASP.NET] 웹서비스 호출시 System.InvalidOperationException: 임시 클래스를 생성할 수 없습니다(result=1) (0) | 2013.03.04 |
[C#] 디버그 출력 (0) | 2013.01.24 |
[C#] FlowLayoutPanel 안에 컨트롤 순서 변경하기 (0) | 2013.01.24 |
[C#] MIDI 제어 하기 (0) | 2013.01.23 |