⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.pas

📁 传奇世界商业插件Delphi源代码!!!好不容易才弄到手的!发出来共享
💻 PAS
字号:
unit MainFrm;

interface

uses
  Windows, Messages, SysUtils,StrUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons,EDcode,Grobal2,HUtil32, ComCtrls,FileCtrl,SHELLAPI,
  Menus;

type
  TMainFrm1 = class(TForm)
    OpenDialog1: TOpenDialog;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    Memo1: TMemo;
    Button2: TButton;
    Button1: TButton;
    BitBtn1: TBitBtn;
    Memo2: TMemo;
    Button3: TButton;
    SaveDialog1: TSaveDialog;
    Label1: TLabel;
    ListBox1: TListBox;
    Button4: TButton;
    Edit1: TEdit;
    Button5: TButton;
    Button6: TButton;
    ListBox2: TListBox;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    PopupMenu1: TPopupMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    Button7: TButton;
    PopupMenu2: TPopupMenu;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);
    procedure ListBox1DblClick(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainFrm1: TMainFrm1;
  LoadList: TStringList;
  sScritpFileName,savefilename:string;
implementation
 uses _Decode,_Function,_Md5,_Const;
{$R *.dfm}

procedure enCodeStringList(StringList: TStringList);
var
  I: Integer;
  sLine:String;
begin
  if StringList.Count = 0 then exit;

  if StringList.Count > 0 then begin
  



    for I := 0 to StringList.Count - 1 do begin
    sLine:=StringList.Strings[I];
    sLine:=EncodeStrjb(sLine,'#;;;#');//'AftEnCode'
    StringList.Strings[I]:=sLine;
    end;

    StringList.Insert(0,sENCYPTSCRIPTFLAG);
  end;
end;


procedure deCodeStringList(StringList: TStringList);
var
  I: Integer;
  sLine:String;
begin
  if StringList.Count = 0 then exit;
  if StringList.Count > 0 then begin
    for I := 1 to StringList.Count - 1 do begin
    sLine:=StringList.Strings[I];
 //   if not CompareLStr(sLine,sENCYPTSCRIPTFLAG,length(sENCYPTSCRIPTFLAG)) then
    sLine:=DecodeStrjb(sLine,'#;;;#');   //;aftecd
     // '// else  sLine:='' ;

    StringList.Strings[I]:=sLine;
    end;
    StringList.Delete(0);
 //   StringList.Insert(0,sENCYPTSCRIPTFLAG);
  end;
end;


procedure TMainFrm1.Button2Click(Sender: TObject);
begin
   sScritpFileName:='' ;
   IF OpenDialog1.Execute THEN  begin
        sScritpFileName:= OpenDialog1.FileName;
   end;
   if sScritpFileName='' then exit;
   label1.Caption:='当前打开文件:'+ sScritpFileName;
   if FileExists(sScritpFileName) then begin

    try

      LoadList.LoadFromFile(sScritpFileName);
    //  enCodeStringList(LoadList);
      memo1.lines.Assign(LoadList);
   //   memo1.Lines.Add(LoadList.Strings[1]) ;
    except
      LoadList.Free;
      exit;
    end;
   end ; //fileexists
end;

procedure TMainFrm1.Button1Click(Sender: TObject);
begin
     // memo1.Clear;
   if  (LoadList.Count>0) and (LoadList.Strings[0]<>sENCYPTSCRIPTFLAG) then begin
      enCodeStringList(LoadList);
      memo2.lines.Assign(LoadList);
   end else  Application.MessageBox('脚本已经加密过了,请保存!!!','提示信息',MB_OK + MB_ICONWARNING);
end;

procedure TMainFrm1.FormCreate(Sender: TObject);
begin
       LoadList:=TStringList.Create;
end;

procedure TMainFrm1.BitBtn1Click(Sender: TObject);
begin
     {   deCodeStringList(LoadList);
        memo1.lines.Assign(LoadList); }
end;

procedure TMainFrm1.Button3Click(Sender: TObject);
begin
     savefilename:='';
     if  (LoadList.Count>0) and (LoadList.Strings[0]=sENCYPTSCRIPTFLAG) then begin
       if  SaveDialog1.Execute then  savefilename:=SaveDialog1.FileName;
       if savefilename<>'' then  LoadList.SaveToFile(savefilename);
     end else  Application.MessageBox('请先加密脚本,再按保存!!!','提示信息',MB_OK + MB_ICONWARNING);

end;

procedure TMainFrm1.Button5Click(Sender: TObject);
var Dir: string;
begin
  if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then  begin
    edit1.Text := Dir+'\';
    button6.Enabled:=true;
  end;
end;

procedure TMainFrm1.Button4Click(Sender: TObject);
begin
  OpenDialog1.Options:=[ofHideReadOnly,ofAllowMultiSelect,ofEnableSizing];
  IF OpenDialog1.Execute THEN  begin
     ListBox1.Items.AddStrings(OpenDialog1.Files);
  end;
  OpenDialog1.Options:=[ofHideReadOnly,ofEnableSizing];

end;

procedure TMainFrm1.ListBox1Click(Sender: TObject);
begin
   label3.Caption:='当前打开文件:'+ListBox1.Items[ListBox1.ItemIndex];
end;

procedure TMainFrm1.Label1Click(Sender: TObject);
begin
     if sScritpFileName<>'' then
      ShellExecute(0,'open',pchar(ExtractFilePath(sScritpFileName)), nil, nil, SW_SHOWNORMAL);
end;

procedure TMainFrm1.ListBox1DblClick(Sender: TObject);
begin
    if (ListBox1.ItemIndex >=0 ) and (ListBox1.ItemIndex <ListBox1.Items.Count ) then
      ShellExecute(0,'open',pchar(ListBox1.Items[ListBox1.ItemIndex]), nil, nil, SW_SHOWNORMAL);

end;

procedure TMainFrm1.N3Click(Sender: TObject);
begin
       listbox1.Clear;
end;

procedure TMainFrm1.N5Click(Sender: TObject);
begin
    ListBox1.Items.Delete(ListBox1.ItemIndex) ; //
end;

procedure TMainFrm1.Button6Click(Sender: TObject);
 var i:integer;
     LoadscriptList: TStringList;
begin
    if listbox1.Items.Count>0 then begin
     LoadscriptList:= TStringList.Create;
     for i:=0 to  listbox1.Items.Count-1 do begin
       LoadscriptList.Clear;
       LoadscriptList.LoadFromFile(listbox1.Items[i]);
       enCodeStringList(LoadscriptList);
       LoadscriptList.SaveToFile(edit1.Text+ExtractFileName(listbox1.Items[i]));
       listbox2.Items.Add(edit1.Text+ExtractFileName(listbox1.Items[i])) ;
     end;
     LoadscriptList.Free;

    end  else  Application.MessageBox('请先添加文件到列表中,再批量加密!!!','提示信息',MB_OK + MB_ICONWARNING);

end;

procedure TMainFrm1.N6Click(Sender: TObject);
begin
     if (ListBox2.ItemIndex >=0 ) and (ListBox2.ItemIndex <ListBox2.Items.Count ) then
      ShellExecute(0,'open',pchar(ListBox2.Items[ListBox1.ItemIndex]), nil, nil, SW_SHOWNORMAL);

end;

procedure TMainFrm1.N7Click(Sender: TObject);
begin
     ListBox2.Items.Clear;
end;

procedure TMainFrm1.Button7Click(Sender: TObject);
 var i:integer;
     LoadscriptList: TStringList;
begin
{    if listbox1.Items.Count>0 then begin
     LoadscriptList:= TStringList.Create;
     for i:=0 to  listbox1.Items.Count-1 do begin
       LoadscriptList.Clear;
       LoadscriptList.LoadFromFile(listbox1.Items[i]);
       deCodeStringList(LoadscriptList);
       LoadscriptList.SaveToFile(edit1.Text+ExtractFileName(listbox1.Items[i]));
       listbox2.Items.Add(edit1.Text+ExtractFileName(listbox1.Items[i])) ;
     end;
     LoadscriptList.Free;

    end  else  Application.MessageBox('请先添加文件到列表中,再批量解密!!!','提示信息',MB_OK + MB_ICONWARNING);
}
end;

end.

⌨️ 快捷键说明

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