📄 frmmain.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace AutoShare
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnBrowser;
private System.Windows.Forms.TextBox txtFolder;
private System.Windows.Forms.FolderBrowserDialog dlgFolder;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Button btnAbout;
private System.Windows.Forms.Label lblFloder;
private System.Windows.Forms.Label lblShareName;
private System.Windows.Forms.TextBox txtShareName;
private System.Windows.Forms.Label lblRemark;
private System.Windows.Forms.TextBox txtRemark;
private System.Windows.Forms.TextBox txtCommand;
private System.Windows.Forms.TextBox txtHelp;
private System.Windows.Forms.GroupBox gbCommand;
private System.Windows.Forms.Label lblMaxUsers;
private System.Windows.Forms.NumericUpDown numMaxUsers;
private System.Windows.Forms.CheckBox chkNoLimited;
private System.Windows.Forms.TextBox txtNetshare;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.GroupBox gbInformation;
private System.Windows.Forms.Button btnRun;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this.btnBrowser = new System.Windows.Forms.Button();
this.txtFolder = new System.Windows.Forms.TextBox();
this.dlgFolder = new System.Windows.Forms.FolderBrowserDialog();
this.gbInformation = new System.Windows.Forms.GroupBox();
this.lblMaxUsers = new System.Windows.Forms.Label();
this.numMaxUsers = new System.Windows.Forms.NumericUpDown();
this.chkNoLimited = new System.Windows.Forms.CheckBox();
this.txtRemark = new System.Windows.Forms.TextBox();
this.lblRemark = new System.Windows.Forms.Label();
this.lblShareName = new System.Windows.Forms.Label();
this.lblFloder = new System.Windows.Forms.Label();
this.txtShareName = new System.Windows.Forms.TextBox();
this.gbCommand = new System.Windows.Forms.GroupBox();
this.btnClear = new System.Windows.Forms.Button();
this.txtNetshare = new System.Windows.Forms.TextBox();
this.txtCommand = new System.Windows.Forms.TextBox();
this.btnExit = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.btnRun = new System.Windows.Forms.Button();
this.txtHelp = new System.Windows.Forms.TextBox();
this.gbInformation.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numMaxUsers)).BeginInit();
this.gbCommand.SuspendLayout();
this.SuspendLayout();
//
// btnBrowser
//
this.btnBrowser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBrowser.Location = new System.Drawing.Point(416, 16);
this.btnBrowser.Name = "btnBrowser";
this.btnBrowser.Size = new System.Drawing.Size(64, 23);
this.btnBrowser.TabIndex = 2;
this.btnBrowser.Text = "&Browser";
this.btnBrowser.Click += new System.EventHandler(this.btnBrowser_Click);
//
// txtFolder
//
this.txtFolder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtFolder.Location = new System.Drawing.Point(96, 16);
this.txtFolder.Name = "txtFolder";
this.txtFolder.Size = new System.Drawing.Size(304, 21);
this.txtFolder.TabIndex = 1;
this.txtFolder.Text = "";
this.txtFolder.TextChanged += new System.EventHandler(this.txtFolder_TextChanged);
//
// gbInformation
//
this.gbInformation.Controls.Add(this.lblMaxUsers);
this.gbInformation.Controls.Add(this.numMaxUsers);
this.gbInformation.Controls.Add(this.chkNoLimited);
this.gbInformation.Controls.Add(this.txtRemark);
this.gbInformation.Controls.Add(this.lblRemark);
this.gbInformation.Controls.Add(this.lblShareName);
this.gbInformation.Controls.Add(this.lblFloder);
this.gbInformation.Controls.Add(this.txtShareName);
this.gbInformation.Controls.Add(this.btnBrowser);
this.gbInformation.Controls.Add(this.txtFolder);
this.gbInformation.Location = new System.Drawing.Point(8, 8);
this.gbInformation.Name = "gbInformation";
this.gbInformation.Size = new System.Drawing.Size(496, 120);
this.gbInformation.TabIndex = 0;
this.gbInformation.TabStop = false;
this.gbInformation.Text = "&Information";
//
// lblMaxUsers
//
this.lblMaxUsers.AutoSize = true;
this.lblMaxUsers.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblMaxUsers.Location = new System.Drawing.Point(24, 88);
this.lblMaxUsers.Name = "lblMaxUsers";
this.lblMaxUsers.Size = new System.Drawing.Size(66, 17);
this.lblMaxUsers.TabIndex = 7;
this.lblMaxUsers.Text = "&Max Users:";
this.lblMaxUsers.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// numMaxUsers
//
this.numMaxUsers.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.numMaxUsers.Enabled = false;
this.numMaxUsers.Location = new System.Drawing.Point(96, 88);
this.numMaxUsers.Maximum = new System.Decimal(new int[] {
10000,
0,
0,
0});
this.numMaxUsers.Minimum = new System.Decimal(new int[] {
1,
0,
0,
0});
this.numMaxUsers.Name = "numMaxUsers";
this.numMaxUsers.Size = new System.Drawing.Size(88, 21);
this.numMaxUsers.TabIndex = 8;
this.numMaxUsers.Value = new System.Decimal(new int[] {
10,
0,
0,
0});
this.numMaxUsers.ValueChanged += new System.EventHandler(this.numMaxUsers_ValueChanged);
//
// chkNoLimited
//
this.chkNoLimited.Checked = true;
this.chkNoLimited.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkNoLimited.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.chkNoLimited.Location = new System.Drawing.Point(200, 88);
this.chkNoLimited.Name = "chkNoLimited";
this.chkNoLimited.Size = new System.Drawing.Size(96, 24);
this.chkNoLimited.TabIndex = 9;
this.chkNoLimited.Text = "&No Limited";
this.chkNoLimited.CheckedChanged += new System.EventHandler(this.chkNoLimited_CheckedChanged);
//
// txtRemark
//
this.txtRemark.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtRemark.Location = new System.Drawing.Point(96, 64);
this.txtRemark.Name = "txtRemark";
this.txtRemark.Size = new System.Drawing.Size(304, 21);
this.txtRemark.TabIndex = 6;
this.txtRemark.Text = "";
this.txtRemark.TextChanged += new System.EventHandler(this.txtRemark_TextChanged);
//
// lblRemark
//
this.lblRemark.AutoSize = true;
this.lblRemark.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblRemark.Location = new System.Drawing.Point(40, 64);
this.lblRemark.Name = "lblRemark";
this.lblRemark.Size = new System.Drawing.Size(48, 17);
this.lblRemark.TabIndex = 5;
this.lblRemark.Text = "&Remark:";
this.lblRemark.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblShareName
//
this.lblShareName.AutoSize = true;
this.lblShareName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblShareName.Location = new System.Drawing.Point(16, 40);
this.lblShareName.Name = "lblShareName";
this.lblShareName.Size = new System.Drawing.Size(73, 17);
this.lblShareName.TabIndex = 3;
this.lblShareName.Text = "&Share Name:";
this.lblShareName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblFloder
//
this.lblFloder.AutoSize = true;
this.lblFloder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblFloder.Location = new System.Drawing.Point(40, 16);
this.lblFloder.Name = "lblFloder";
this.lblFloder.Size = new System.Drawing.Size(48, 17);
this.lblFloder.TabIndex = 0;
this.lblFloder.Text = "&Floder:";
this.lblFloder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtShareName
//
this.txtShareName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShareName.Location = new System.Drawing.Point(96, 40);
this.txtShareName.Name = "txtShareName";
this.txtShareName.Size = new System.Drawing.Size(304, 21);
this.txtShareName.TabIndex = 4;
this.txtShareName.Text = "";
this.txtShareName.TextChanged += new System.EventHandler(this.txtShareName_TextChanged);
//
// gbCommand
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -