C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[48739] 파일에 저장된 데이터 읽기
김명섭 [myongsubi] 1358 읽음    2007-04-03 20:11
파일에 저장된 데이터를 읽어서 배열에 저장할려고 합니다.
----------------------------------------------------------------
int iFileHandle;
int iFileLength;
int iBytesRead;


char *pszBuffer;

    iFileHandle=FileOpen(FileOpen1->Dialog->FileName,fmOpenRead);
    iFileLength=FileSeek(iFileHandle,0,2);
    FileSeek(iFileHandle,0,0);
    pszBuffer=new char[iFileLength+1];
    iBytesRead=FileRead(iFileHandle,pszBuffer,iFileLength);
    FileClose(iFileHandle);

    for (int i=0;i<iFileLength;i++)
    {
       Memo1->Lines->Add(pszBuffer[i]);
        int buffer=pszBuffer[i];
        Memo1->Lines->Add(buffer);
    }


        char sendData[17];
             sendData[0]=0x81;
             sendData[1]=0x21;
             sendData[2]=0x00;
             sendData[3]=0x00;
             sendData[4]=0x41;
             sendData[5]=0x10;
             sendData[6]=0x00;
             sendData[7]=0x0C;
             sendData[8]=0x30;
             sendData[9]=0x31;
             sendData[10]=0x33;
             sendData[11]=0x38;
             sendData[12]=0x02;
             sendData[13]=0x00;
             sendData[14]=0x00;
             sendData[15]=0x00;
            
        MySendStream->Write(sendData,16);
        NMUDP1->SendStream(MySendStream);

+ -

관련 글 리스트
48739 파일에 저장된 데이터 읽기 김명섭 1358 2007/04/03
48743     Re:파일에 저장된 데이터 읽기 이현진 1430 2007/04/04
48756         고맙습니다^^; 김명섭 984 2007/04/04
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.