国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

url編碼與解碼工具代碼

2019-11-18 17:58:10
字體:
來源:轉載
供稿:網友



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.


上一篇:一個多線程后臺掃描的程序和源代碼

下一篇:如何取得某些特殊文件夾路徑

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 安泽县| 东乡族自治县| 左贡县| 滨海县| 东乡族自治县| 普定县| 灵丘县| 台山市| 安徽省| 伊吾县| 西贡区| 来宾市| 军事| 长垣县| 芦溪县| 阳谷县| 怀集县| 石城县| 穆棱市| 河东区| 财经| 城步| 郧西县| 泉州市| 云和县| 永城市| 喀什市| 高雄市| 长岭县| 昭平县| 乐业县| 达孜县| 攀枝花市| 南部县| 电白县| 扬州市| 汝州市| 武山县| 青阳县| 宁津县| 宁远县|