📄 ftpexplorerdlg.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using NiranjanFTP;
namespace FTPExplorer
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class FTPExplorerDlg : System.Windows.Forms.Form {
private System.Windows.Forms.MainMenu m_MainMenu;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.ImageList m_iLToolBar;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem18;
private System.Windows.Forms.MenuItem menuItem19;
private System.Windows.Forms.MenuItem menuItem20;
private System.Windows.Forms.ImageList m_iLTreeView;
private System.Windows.Forms.TreeView m_tVFolders;
private System.Windows.Forms.ListView m_lVFiles;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.Windows.Forms.ToolBarButton toolBarButton6;
private System.Windows.Forms.ToolBarButton toolBarButton7;
private System.Windows.Forms.ToolBarButton toolBarButton8;
private System.Windows.Forms.ToolBarButton toolBarButton9;
private System.Windows.Forms.ToolBarButton toolBarButton10;
private System.Windows.Forms.ToolBarButton toolBarButton11;
private System.Windows.Forms.ToolBarButton toolBarButton12;
private System.Windows.Forms.ToolBarButton toolBarButton13;
private System.Windows.Forms.ToolBarButton toolBarButton14;
private System.Windows.Forms.ToolBarButton toolBarButton15;
private System.Windows.Forms.ToolBarButton toolBarButton17;
private System.Windows.Forms.StatusBar m_sbStatus;
private System.Windows.Forms.ToolTip toolTip1;
private System.ComponentModel.IContainer components;
private FTPClient m_FtpClient;
private System.Windows.Forms.DataGrid m_dGFiles;
private TreeNode m_tnRootNode;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
private string m_strLocalFolder;
private bool m_bNewNodeFlag;
private int m_iFolderCount, m_iFileCount;
public FTPProperties m_FTPProperties;
public FTPExplorerDlg(FTPMainMdiForm l_formParent) {
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
MdiParent = l_formParent;
m_FTPProperties = new FTPProperties();
m_tnRootNode = null;
EnableToolBarButtons(false);
toolBarButton3.Enabled = true;
toolBarButton17.Enabled = true;
m_strLocalFolder = "C:\\";
m_bNewNodeFlag = false;
InitControls();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing ) {
if( disposing ) {
if (components != null) {
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FTPExplorerDlg));
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.toolBarButton9 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.m_iLToolBar = new System.Windows.Forms.ImageList(this.components);
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.m_MainMenu = new System.Windows.Forms.MainMenu();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuItem12 = new System.Windows.Forms.MenuItem();
this.menuItem13 = new System.Windows.Forms.MenuItem();
this.menuItem14 = new System.Windows.Forms.MenuItem();
this.menuItem15 = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem18 = new System.Windows.Forms.MenuItem();
this.menuItem19 = new System.Windows.Forms.MenuItem();
this.menuItem20 = new System.Windows.Forms.MenuItem();
this.menuItem17 = new System.Windows.Forms.MenuItem();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton7 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton10 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton11 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton12 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton13 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton14 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton15 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton17 = new System.Windows.Forms.ToolBarButton();
this.m_sbStatus = new System.Windows.Forms.StatusBar();
this.m_dGFiles = new System.Windows.Forms.DataGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.m_lVFiles = new System.Windows.Forms.ListView();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.m_tVFolders = new System.Windows.Forms.TreeView();
this.m_iLTreeView = new System.Windows.Forms.ImageList(this.components);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.m_dGFiles)).BeginInit();
this.SuspendLayout();
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 2;
this.toolBarButton3.ToolTipText = "Configure FTP connection";
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 1;
this.toolBarButton2.ToolTipText = "Disconnect from FTP server";
//
// statusBarPanel3
//
this.statusBarPanel3.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel3.Width = 10;
//
// toolBarButton9
//
this.toolBarButton9.ImageIndex = 6;
this.toolBarButton9.ToolTipText = "Upload File to Remote Server";
//
// toolBarButton8
//
this.toolBarButton8.ImageIndex = 5;
this.toolBarButton8.ToolTipText = "Refresh folders and files";
//
// statusBarPanel1
//
this.statusBarPanel1.Width = 250;
//
// m_iLToolBar
//
this.m_iLToolBar.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.m_iLToolBar.ImageSize = new System.Drawing.Size(22, 22);
this.m_iLToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("m_iLToolBar.ImageStream")));
this.m_iLToolBar.TransparentColor = System.Drawing.Color.Transparent;
//
// menuItem8
//
this.menuItem8.Index = 3;
this.menuItem8.Text = "Co&nfigure";
this.menuItem8.Click += new System.EventHandler(this.OnClickServerConfigure);
//
// statusBarPanel2
//
this.statusBarPanel2.Width = 250;
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.Text = "-";
//
// menuItem5
//
this.menuItem5.Index = 5;
this.menuItem5.Text = "C&lose";
this.menuItem5.Click += new System.EventHandler(this.OnClickClose);
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3,
this.menuItem4,
this.menuItem8,
this.menuItem9,
this.menuItem5});
this.menuItem1.Text = "&Server";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "&Connect";
this.menuItem2.Click += new System.EventHandler(this.OnClickServerConnect);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "&Disconnect";
this.menuItem3.Click += new System.EventHandler(this.OnClickServerDisconnect);
//
// menuItem9
//
this.menuItem9.Index = 4;
this.menuItem9.Text = "-";
//
// m_MainMenu
//
this.m_MainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem10});
//
// menuItem10
//
this.menuItem10.Index = 1;
this.menuItem10.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem11,
this.menuItem12,
this.menuItem13,
this.menuItem14,
this.menuItem15,
this.menuItem16,
this.menuItem18,
this.menuItem19,
this.menuItem20,
this.menuItem17});
this.menuItem10.Text = "&Options";
//
// menuItem11
//
this.menuItem11.Index = 0;
this.menuItem11.Text = "&Create Folder";
this.menuItem11.Click += new System.EventHandler(this.OnClickOptionsCreateFolder);
//
// menuItem12
//
this.menuItem12.Index = 1;
this.menuItem12.Text = "&Delete Folder";
this.menuItem12.Click += new System.EventHandler(this.OnClickOptionsDeleteFolder);
//
// menuItem13
//
this.menuItem13.Index = 2;
this.menuItem13.Text = "-";
//
// menuItem14
//
this.menuItem14.Index = 3;
this.menuItem14.Text = "&Refresh";
this.menuItem14.Click += new System.EventHandler(this.OnClickOptionsRefresh);
//
// menuItem15
//
this.menuItem15.Index = 4;
this.menuItem15.Text = "&Upload File";
this.menuItem15.Click += new System.EventHandler(this.OnClickOptionsUploadFile);
//
// menuItem16
//
this.menuItem16.Index = 5;
this.menuItem16.Text = "Dow&nload File";
this.menuItem16.Click += new System.EventHandler(this.OnClickOptionsDownloadFile);
//
// menuItem18
//
this.menuItem18.Index = 6;
this.menuItem18.Text = "-";
//
// menuItem19
//
this.menuItem19.Index = 7;
this.menuItem19.Text = "Delete &File";
this.menuItem19.Click += new System.EventHandler(this.OnClickOptionsDeleteFile);
//
// menuItem20
//
this.menuItem20.Index = 8;
this.menuItem20.Text = "-";
//
// menuItem17
//
this.menuItem17.Index = 9;
this.menuItem17.Text = "Set &Local Folder";
this.menuItem17.Click += new System.EventHandler(this.OnClickOptionsSetLWD);
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6,
this.toolBarButton7,
this.toolBarButton8,
this.toolBarButton9,
this.toolBarButton10,
this.toolBarButton11,
this.toolBarButton12,
this.toolBarButton13,
this.toolBarButton14,
this.toolBarButton15,
this.toolBarButton17});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.m_iLToolBar;
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -