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
[62611] Re:[질문] IdHTTPServer1 로 웹서버 만들다... ???
박영목.월천 [gsbsoft] 1735 읽음    2010-10-08 03:08
아래로 가시면 소스와 실행파일... 다 있습니다.

http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=1011

---------------------------------------------------------------------------------

추가했습니다.


2. msLogin 메모리 할당하고 해제를 하지 않아도 되는지?  해제하면... 동작이 이상한 것 같던데...  몇주전에
    해서 생각이 잘 안남..

    2번도 의문 있었는 데...  다른 것 찾다 보니...  아래의 내용이 있더군요....

http://www.kumanov.com/docs/prog/indy/007391.html

TIdHTTPResponseInfo.FreeContentStream
TIdHTTPResponseInfo, See Also
Indicates if the object instance can free its ContentStream.
property FreeContentStream: Boolean;
Description
FreeContentStream is a Boolean property that indicates if the object instance can free the TStream resource allocated in ContentStream. FreeContentStream is set to True in the Create constructor, and insures that ContentStream will be released, if assigned prior to retrieving an HTTP response, in the Destroy method.
Under normal circumstances, FreeContentStream is not changed during the lifetime of the HTTP response. Set FreeContentStream to False when ContentStream is assigned manually, and the stream must continue to exist even after destruction of the HTTP response.

FreeContentStream  값이 기본으로 true로 되어 있기 때문에...  응답 후에 msLogin에 있는 내용 자동으로 삭제시킵니다.


박영목.월천 님이 쓰신 글 :
: IdHTTPServer1 로 웹서버 만드는 것... 쉬운 것 같아도 어려움이 제법 있네요...
:
: 게시판에도 없고... 궁금한 것 질문드립니다...    아시는 분만  답변 부탁드립니다....  ^^
:
:
";

:
: 1. 이미지를 넣고 싶어서...  이렇게 했더니 안되네요...
:     그래서... 하드 경로 주어도 안되고...  그래서 src=에 다른 웹서버의(http://...) 이런씩으로 주니까 되는 데...
:     IdHTTPServer1 이것이 돌아가는 그 폴더의 이미지를 나타내고 싶은 데....  느낌으로는 IdHTTPServer1에
:     어떤 경로를 넣어야 할 것 같은 생각이 더는 데...????     모르겠습니다.
:
:
: TMemoryStream *msLogin = new TMemoryStream();
:
: 2. msLogin 메모리 할당하고 해제를 하지 않아도 되는지?  해제하면... 동작이 이상한 것 같던데...  몇주전에
:    해서 생각이 잘 안남..
:
:
: 3. 웹에서 영문자를 입력해서
이곳으로 넘기면 잘 오는 데...
:     한글을 입력해서 넘기면...  %B1%C0 이런씩으로 IdHTTPServer1 여기로 넘어오네요...
:     억지로 하면 어떻게던 변환하겠는 데... 간단한 방법이 있을 것 같은데.... ???
:
:
:
: 아래의  asHTMLLogin += "
"; 이 부분은 실제적인 : confirm.cgi 파일이 없는 데 이렇게 하고 있습니다. 보안상 좋을 것 같아서... 재밌고 신기하네요... : 이상하게 생각할까봐 설명을 드렸습니다. : :
: void __fastcall TForm1::IdHTTPServer1CommandGet(TIdPeerThread *AThread,
:       TIdHTTPRequestInfo *ARequestInfo, TIdHTTPResponseInfo *AResponseInfo)
: {
: 
:     AnsiString asHTMLLogin =  "";
: 
:     asHTMLLogin += "";
: 
:     asHTMLLogin += "  ";
:     asHTMLLogin += "    Door Remote Control ";
:     asHTMLLogin += "  ";
:     asHTMLLogin += " ";
:     asHTMLLogin += " 
"; : asHTMLLogin += ""; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += "
"; : asHTMLLogin += " "; : asHTMLLogin += " "; : asHTMLLogin += " "; : asHTMLLogin += ""; : asHTMLLogin += "
"; : asHTMLLogin += " "; : asHTMLLogin += ""; : //-------------------------------------------------------- : : asHTML += ""; : : : AnsiString LFilename; : : TStringStream *aResponseStream; : AnsiString aRequestContent, aResponseContent; : : LFilename = ARequestInfo->Document; : : if( LFilename == "/" ) : { : TMemoryStream *msLogin = new TMemoryStream(); : msLogin->SetSize( asHTMLLogin.Length() ); : msLogin->Seek( 0, soFromBeginning ); //Position = 0; : msLogin->Write( asHTMLLogin.c_str(), asHTMLLogin.Length() ); : : AResponseInfo->ContentStream = msLogin; : } : } :

+ -

관련 글 리스트
60965 [질문] IdHTTPServer1 로 웹서버 만들다... ??? 박영목.월천 1772 2010/05/04
62611     Re:[질문] IdHTTPServer1 로 웹서버 만들다... ??? 박영목.월천 1735 2010/10/08
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.