HOME 개발팁 파일 읽고쓰기

프로그램 작업하다 좋은 팁, 정보, 테스트를 기록하는 곳입니다.


delphi | 파일 읽고쓰기

페이지 정보

작성자 굿스웹 작성일19-01-07 14:18 조회788회 댓글0건

본문

procedure TfrmMain.btnTestClick(Sender: TObject);
var
  iniSet:TIniFile;
  sFile :string;
  iT1  :integer;
  sT    :string;
  bT    :bool;
begin
  sFile := 'temp.ini';

  // INI파일 만들기(기존에 파일있는 경우는 파일 열기로 됨)
  iniSet := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
  try
    // INI파일에 정수 쓰기
    iniSet.WriteInteger('Section', 'Num', 33);
    // INI파일에 문자열 쓰기
    iniSet.WriteString('Section', 'String', 'TESTINI');
    // INI파일에 Bool형 쓰기
    iniSet.WriteBool('Section', 'Bool', true);
  finally
    // INI파일 닫기
    iniSet.Free;
  end;

  iniSet := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
  try
    // INI파일에 정수 읽기
    iT1 := iniSet.ReadInteger('Section', 'Num', 1);
    // INI파일에 문자열 읽기
    sT := iniSet.ReadString('Section', 'String', 'New Form');
    // INI파일에 Bool형 읽기
    bT := iniSet.ReadBool('Section', 'Bool', false);
  finally
    iniSet.Free;
  end;
end;

[주소복사] https://www.goodsweb.kr/?u=D410x0yd
SNS 알리기
핀터레스트
텔레그램로
블로그로
카카오스토리
카톡 공유

관련 블로그
로딩중


4명  IP : 18.191.♡.36
001 34.♡.82.76 node 윈도우 10 서비스 등록 & 삭제 - 개발팁
(/bbs/board.php?bo_table=tip&wr_id=229)
002 34.♡.82.77 MySQL 내장 함수 정리 - 개발팁
(/bbs/board.php?bo_table=tip&wr_id=68)
003 34.♡.82.78 갤러리
(/bbs/board.php?bo_table=photo&sca=)
004 141.♡.62.169 오류안내 페이지
(/bbs/write.php?bo_table=free)

접속자
  • 오늘 : 85
  • 어제 : 357
  • 최대 : 874
  • 전체 : 403,298

검색로봇(Robots) 최근 방문시간
  • BING : 1시간 전
  • GOOGLE : 13시간 전
  • NAVER : 1일 전
  • DAUM : 1일 전

ETH : 0x8abf3B748ab78828AE07685e4fd53d1a606f18D3



페이스북 네이버 블로그 굿스웹 쇼핑몰 네이버 카페 굿스웹 트위터 굿스웹 티스토리 Google Play