Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- DataGridView 직접 입력
- mosquitto.conf
- pm2 시작
- setInterval clear
- pm2 상태 확인
- html #select #option #multiple
- map이 undefined가 뜰 때
- setInterval 정지
- allow_anonymouse
- datagridview 직접입력
- pm2 확인
- mySQL_Replication
- Replication
- mosquitto
- timepicker
- listener 1883
- 서버동기화
- c# datagridview 데이터 넣기
- 1883
- 공인IP
- 맥 어드레스
- pm2
- setInterval 중지
- transfer
- invalid data
- 데이터테이블 데이터 넣기
- pm2 설치
- AntDesign
- setInterval 외부 정지
- DatePicker
Archives
- Today
- Total
개발 노트
C# listbox 텍스트파일 저장후 불러오기 본문
리스트 저장버튼 만든후
함수생성
private void buttonTopicSave_Click(object sender, EventArgs e)
{
StreamWriter sw;
sw = new StreamWriter("Sub.txt");
int nCount = listBoxSub.Items.Count;
for (int i = 0; i < nCount; i++)
{
listBoxSub.Items[i] += "\r\n";
sw.Write(listBoxSub.Items[i]);
}
sw.Close();
}
생성된 패스값 불러와서 리스트박스로 가져오기
private void buttonTopicOpen_Click(object sender, EventArgs e)
{
string currentPath = System.IO.Directory.GetCurrentDirectory();
StreamReader file = new StreamReader(currentPath + "\\Sub.txt", Encoding.Default);
string s = "";
while (s != null)
{
s = file.ReadLine();
if (!string.IsNullOrEmpty(s)) listBoxSub.Items.Add(s);
}
file.Close();
}
'프로그래밍 > C#' 카테고리의 다른 글
System.IO 파일입출력 텍스트모드 바이너리모드 (0) | 2022.03.10 |
---|---|
로그파일저장 (0) | 2022.03.10 |
C# 현재경로로 파일 저장하기 (0) | 2022.03.07 |
C# ini 저장해서 재실행시 불러오기 (0) | 2022.03.07 |
mosquitto conf (0) | 2022.03.07 |