일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- FGPA #반도체설계 #verilog #시프트레지스터 #uart
- ordering model
- ERROR RESPONSE
- 구조적모델링
- Interoperability
- QoS
- Low-power Interface
- STM32
- 스텝모터
- FPGA
- AXI3
- AXI4
- stepmotor
- 카운터
- Multiple outstanding
- Verilog
- 펌웨어
- tff
- 임베디드시스템
- single copy atomic size
- SoC
- Multiple transaction
- ABMA
- 레지스터슬라이스
- out-of-order
- cacheable
- atomic access
- AMBA
- APB3
- T flip flop
Archives
- Today
- Total
CHIP KIDD
[C#] 5. 파일처리(텍스트파일) 본문
using System;
using System.IO;
namespace Day02_02_파일처리
{
class Program
{
static void Main(string[] args)
{
// *파일처리의 3단계
// 파일 열기 --> 파일읽기/쓰기(반복) --> 파일 닫기
// * 파일의 종류 : 텍스트 파일, 바이너리 파일
// * 텍스트 파일 : 메모장에서 열어서 글자처럼 보임.
// --> 1바이트가 의미가 있음.
// * 바이너리 : 비트가 의미. 2비트 색상, 3비트 크기,7 비트.....
string fullName = "c:/temp/data1.txt";
string writeName = "c:/temp/data2.txt";
StreamReader sr
= new StreamReader(new FileStream(fullName, FileMode.Open));
StreamWriter sw
= new StreamWriter(new FileStream(writeName, FileMode.Create));
string line1;
while(!sr.EndOfStream)
{
line1 = sr.ReadLine();
Console.WriteLine(line1);
sw.WriteLine(line1);
}
sr.Close();
sw.Close();
}
}
}
'전기전자 > C# 시각화프로그래밍' 카테고리의 다른 글
[C#] 7. 그림파일 알고리즘 Basic (0) | 2021.04.14 |
---|---|
[C#] 6. 파일처리 바이너리파일 (0) | 2021.04.14 |
[C#] 4. 2차원 배열 (0) | 2021.04.14 |
[C#] 3. 배열기본 : 동적메모리할당 / 가변배열 (1) | 2021.04.13 |
[C#] 2. 조건문 반복문 (0) | 2021.04.13 |