Some people say that programmers have become assembly workers, actually makes sense to use the control module + a small amount of code can be achieved, delphi 5.0 provides a wealth of internet control, using tcp / ip client - server can resolve the problem. The key control is serversocket, we imitate iphunter interface with a button1 (button), a combobox1 (for display), the three most basic controls placed on the blank form you can start writing code.
First, the combobox1 must be able to display more than one ip, we set a variable y to accumulate combobox1.items [y],
var y: integer;
Our idea is as follows, when serversocket activities port (port) received on tcp / ip protocol when the link request, return to the other side of the ip value, passed to the combobox is displayed. Activation by the button1 control serversocket, that is, open closed ports.
We serversocket's on clientconnect event to add about code
procedure tform1.serversocket11clientconnect (sender: tobject;
socket: tcustomwinsocket);
begin
combobox1.items.insert (y ,'''');// add a blank record
combobox1.items [y]: = socket.remoteaddress; / / access each other's ip
label1.text: =''were caught''+ inttostr (y +1) +''a ip'';// with a label to display the total number of ip arrested
y: = y +1; / / counter variable by 1
socket.close;
end;
Now, the button1 the caption property is set to''Start'', in its Click event add the following code
procedure tform1.speedbutton7click (sender: tobject);
begin
if speedbutton7.caption =''Start''then
begin
serversocket11.port: = 80; / / phrase can be set in the serversocket properties, capture the browser's connection
serversocket11.active: = true; / / activate the port
speedbutton7.caption: =''stop'';
end
else
begin
serversocket11.active: = false; / / close the port
speedbutton7.caption: =''begin'';
combobox1.clear; / / end of the capture, clear the history information
y: = 0; / / Reset counter variable
end;
end;
Recommended links:
ASF converter
3GP To WMV
Avgcmgr.exe Error Eliminate Pc Errors
QT TO WMV
No comments:
Post a Comment