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
[15901] Re:자신의 아이피를 알려면?
박종민.BacTeria [bacteria] 1387 읽음    2002-02-28 09:23
안녕 하세요?

BacTeria 박종민 입니다.

들렀다가 또 끼적거립니다.

아래 제라툴님이 언급하셨던 IP 얻는 방법 입니다.

참고 하세요~ 참!! 델파이 소스네요~

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

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation


uses WinSock;

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
  wVersionRequested: WORD;
  wsaData: TWSAData;
begin
  wVersionRequested := MAKEWORD(1, 1);
  WSAStartup(wVersionRequested, wsaData);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  p: PHostEnt;
  s: array[0..128] of char;
  p2: pchar;
begin
{Get the computer name}
GetHostName(@s, 128);
p := GetHostByName(@s);
Memo1.Lines.Add(p^.h_Name);

{Get the IpAddress}
p2 := iNet_ntoa(PInAddr(p^.h_addr_list^)^);
Memo1.Lines.Add(p2);
end;

end.


모라 님이 쓰신 글 :
:
: 볼랜드 소켓이나 인디 소켓쪽으로 자신의 아이피를 알려면 어떻해야 하죠?
:
:

+ -

관련 글 리스트
15895 자신의 아이피를 알려면? 모라 820 2002/02/28
15901     Re:자신의 아이피를 알려면? 박종민.BacTeria 1387 2002/02/28
15898     Re:자신의 아이피를 알려면? 제라툴 1119 2002/02/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.