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

📄 filesyn.~pas

📁 文件同步
💻 ~PAS
字号:
unit filesyn;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    ComboBox2: TComboBox;
    ComboBox1: TComboBox;
    Button2: TButton;
    Button3: TButton;
    procedure FormShow(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses SSMainFrm;

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
var
  Drive: Char;
  DriveLetter: String[1];
begin
  for Drive := 'E' to 'Z' do
  begin
    DriveLetter := Drive ;
    FORM1.ComboBox2.Items.Add(DriveLetter);
    FORM1.ComboBox1.Items.Add(DriveLetter);
  end;
  ComboBox2.ItemIndex:=0;
  ComboBox1.ItemIndex:=0;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
   Item:TListItem;
   i:Integer;
begin
  for i:=0 to SSMainForm.listview3.Items.Count -1 do
  begin
     if  (SSMainForm.ListView3.Items[i].SubItems[0]=ComboBox1.Text) or (ComboBox1.Text=ComboBox2.Text) then
     begin
      Application.MessageBox(PAnsiChar('目标盘符: ['+combobox1.text+'] 已存在,请不要重复添加'),'提示',MB_OK);
      exit
     end;
      end;
 Item:=SSMainForm.ListView3.Items.Add;
 Item.Caption:=ComboBox2.Text;
 Item.SubItems.Add(ComboBox1.Text)
end;

end.

⌨️ 快捷键说明

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