whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

158 Visitors Online


 
...download a webpage with a hidden IP?
Autor: Christian Poljac
Homepage: www.big-x.cjb.net
[ Print tip ]  

Tip Rating (16):  
     


{ Add a button and memo }

implementation

{$R *.dfm}

uses
  
Urlmon;

procedure TForm1.Button1Click(Sender : TObject);
var
  
ca : iinterface;
  rls : Integer;
  stat : iBindStatusCallBack;
  rr : Cardinal;
  tag : _tagBindInfo;
  exGuid : tguid;
  noIp : Pointer;
  res : HResult;
begin
  
// Make a 0.0.0.0 ip giud
  
exGuid.D1 := rr;
  exGuid.D2 := word('0');
  exGuid.D3 := word('.');
  // Set Tag options
  
with tag do 
  begin
    
// set "0." ip guid
    
iid := exGuid;
    // set needed size
    
cbSize := sizeOf('www.big-x.cjb.net');
    // Add ip hiding ( not tested, but should work )
    
securityAttributes.lpSecurityDescriptor := noIp;
    securityAttributes.nLength := length('0.0.0.0');
    securityAttributes.bInheritHandle := True;
  end;{
 Extra: res := stat.GetBindInfo(rr, tag);}
  //Start downloading webpage
  
try
    
urlmon.URLDownloadToFile(ca, 'www.big-x.cjb.net', 'filename.htm', 1, stat);
  except
    
ShowMessage('Could not download the webpage!');
  end;
  //Load the webpage source to a memo
  
memo1.Lines.LoadFromFile('filename.htm');
end;

 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners