谁有这方面的代码,就是如何向某个IP发送大量的请求(不是搞破坏,只是想了解)
解决方案 »
- database desktop
- 用delphi7下的indy组件写的发送mail出现:bad sequence of commands
- stringgrid的单元个获得焦点的触发事件是什么?
- 菜鸟在线等到各界大虾来帮忙!!!
- delphi有很多第三方控件,怎样用它们呀?
- 请问一下电子计费方面的问题?
- 小弟新近买了一个摄像头,接在电脑上,但我怎么样才能进行视象通话呢,要用什么软件啊?
- 谁有dcomcnfg.exe for win98 的程序给我发一份(dcm98cfg.com),急用,谢了,邮箱:[email protected]
- 怎样定义运行时创建控件的procedure
- 如何关掉TADOConnection的Connected属性为True时那讨厌的英文确认窗口?
- 急,用过ExpressVerticalGrid的请进!
- 我在数据库中存了解种格式的图形文件jpg,icon,bmp想通过cxgrid显示出来,如何实现?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, IdUDPClient, IdBaseComponent, IdComponent,
IdUDPBase, IdUDPServer, IdSocketHandle;type
TForm1 = class(TForm)
Button1: TButton;
IdUDPServer1: TIdUDPServer;
IdUDPClient1: TIdUDPClient;
Memo1: TMemo;
procedure IdUDPServer1UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.IdUDPServer1UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
str: pchar;
pos: Integer;
begin
pos := AData.Size;
str := AllocMem(pos);
AData.ReadBuffer(str^, pos);
self.Memo1.Lines.Add(Str);
FreeMem(str);
end;procedure TForm1.Button1Click(Sender: TObject);
begin
self.IdUDPClient1.Active := false;
self.IdUDPClient1.Active := True;
self.IdUDPClient1.Send('hello my friend');
end;procedure TForm1.FormCreate(Sender: TObject);
begin
self.IdUDPServer1.DefaultPort := 5000;//接受数据端口
self.IdUDPClient1.Port := 5000;
self.IdUDPClient1.Host := '127.0.0.1';//目标机器IP
self.IdUDPServer1.Active := True;
self.IdUDPClient1.Active := True;
end;end.