Ads 468x60px

Smaller time frame always follow the bigger time frame. It's better wait be patience to enter in position than risk with BIG SL. Having strong trading discipline and taking losses when necessary is a sign of serious trading approach

Wednesday, May 30, 2012

Get your own IP Address

uses  Winsock; 


function getIPs: Tstrings; 
type 
  TaPInAddr = array[0..10] of PInAddr; 
  PaPInAddr = ^TaPInAddr; 
var 
  phe: PHostEnt; 
  pptr: PaPInAddr; 
  Buffer: array[0..63] of Char; 
  I: Integer; 
  GInitData: TWSAData; 
begin 

  WSAStartup($101, GInitData); 
  Result := TstringList.Create; 
  Result.Clear; 
  GetHostName(Buffer, SizeOf(Buffer)); 
  phe := GetHostByName(buffer); 
  if phe = nil then Exit; 
  pPtr := PaPInAddr(phe^.h_addr_list); 
  I    := 0; 
  while pPtr^[I] <> nil do 
  begin 
    Result.Add(inet_ntoa(pptr^[I]^)); 
    Inc(I); 
  end; 
  WSACleanup; 
end; 


procedure TForm1.Button1Click(Sender: TObject); 
begin 
  ShowMessage(GetIps.text); 
end;


Source



comments