url编码与解码工具代码

懂得珍惜251325

懂得珍惜251325

2016-02-19 20:46

今天图老师小编给大家介绍下url编码与解码工具代码,平时喜欢url编码与解码工具代码的朋友赶紧收藏起来吧!记得点赞哦~

  
  
  url编码与解码工具代码,做sql注入分析时会用到
  
  代码部分:
  
  unit Unit1;
  
  interface
  
  uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, HTTPApp;
  
  type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Memo2: TMemo;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
    function URLEncode(const msg : String) : String;
    function GetMemoText(memo:TMemo):string;
  public
    { Public declarations }
  end;
  
  var
  Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.Button1Click(Sender: TObject);
  var
  i: Integer;
  ss: string;
  begin
  ss := GetMemoText(Memo1);
  Memo1.Text :=ss;
  Memo2.Clear;
  for i := 1 to Length(ss) do
  begin
    Memo2.Text := Memo2.Text + '%' + IntToHex(Ord(ss), 2);
  end;
  end;
  
  function TForm1.URLEncode(const msg: String): String;
  var
    I : Integer;
  begin
    Result := '';
    for I := 1 to Length(msg) do begin
      if msg[I] = ' ' then
          Result := Result + '+'
      else if msg[I] in ['a'..'z', 'A'..'Z', '0'..'9'] then
          Result := Result + msg[I]
      else
          Result := Result + '%' + IntToHex(ord(msg[I]), 2);
    end;
  
  end;
  
  procedure TForm1.Button2Click(Sender: TObject);
  var ss:string;
  begin
  Memo2.Clear;
  ss :=GetMemoText(Memo1);
  Memo1.Text :=ss;
  Memo2.Text :=HTTPDecode(trim(ss));
  end;
  
  function TForm1.GetMemoText(memo: TMemo): string;
  var i:integer;
  begin
  for i:=0 to memo.Lines.Count-1 do
  begin
    Result :=Result + trim(memo.Lines);
  end;
  end;
  
  end.
  url编码与解码工具附代码
  
  
  url编码与解码工具附代码,代码很简单,做sql注入分析时经常用到,但一时又找不到,就写了一个
  
  
  代码部分:
  
  unit Unit1;
  
  interface
  
  uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, HTTPApp;
  
  type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Memo2: TMemo;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
    function URLEncode(const msg : String) : String;
    function GetMemoText(memo:TMemo):string;
  public
    { Public declarations }
  end;
  
  var
  Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.Button1Click(Sender: TObject);
  var
  i: Integer;
  ss: string;
  begin
  ss := GetMemoText(Memo1);
  Memo1.Text :=ss;
  Memo2.Clear;
  for i := 1 to Length(ss) do
  begin
    Memo2.Text := Memo2.Text + '%' + IntToHex(Ord(ss), 2);
  end;
  end;
  
  function TForm1.URLEncode(const msg: String): String;
  var
    I : Integer;
  begin
    Result := '';
    for I := 1 to Length(msg) do begin
      if msg[I] = ' ' then
          Result := Result + '+'
      else if msg[I] in ['a'..'z', 'A'..'Z', '0'..'9'] then
          Result := Result + msg[I]
      else
          Result := Result + '%' + IntToHex(ord(msg[I]), 2);
    end;
  
  end;
  
  procedure TForm1.Button2Click(Sender: TObject);
  var ss:string;
  begin
  Memo2.Clear;
  ss :=GetMemoText(Memo1);
  Memo1.Text :=ss;
  Memo2.Text :=HTTPDecode(trim(ss));
  end;
  
  function TForm1.GetMemoText(memo: TMemo): string;
  var i:integer;
  begin
  for i:=0 to memo.Lines.Count-1 do
  begin
    Result :=Result + trim(memo.Lines);
  end;
  end;
  
  end.
  
展开更多 50%)
分享

猜你喜欢

url编码与解码工具代码

编程语言 网络编程
url编码与解码工具代码

url编码与解码工具附代码

编程语言 网络编程
url编码与解码工具附代码

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

C++类URL编码和解码使用技巧

编程语言 网络编程
C++类URL编码和解码使用技巧

URL编码与SQL注入

Web开发
URL编码与SQL注入

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

URL编码

C语言教程 C语言函数
URL编码

URL编码处理

Web开发
URL编码处理

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

Delphi中预编译指令如何使用

Delphi中预编译指令如何使用

Dreamweaver教程:弹出窗口

Dreamweaver教程:弹出窗口
下拉加载更多内容 ↓