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

📄 formprepare.cs

📁 工作时用C#编写的WPS密码测试工具,主要用于测试与MSO文件兼容(IO)而写的.功能主要是由MSO文件加密.WPS打开,再由WPS加密,再由MSO打开.每个加密都是根据文件加密类型来加的,此代码.与
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.gbOption.Controls.Add(this.lbOutPath);
			this.gbOption.Controls.Add(this.btnInFile);
			this.gbOption.Controls.Add(this.txtInFile);
			this.gbOption.Controls.Add(this.lbInFile);
			this.gbOption.Controls.Add(this.cbTestProject);
			this.gbOption.Controls.Add(this.lbTestProject);
			this.gbOption.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.gbOption.Location = new System.Drawing.Point(2, 2);
			this.gbOption.Name = "gbOption";
			this.gbOption.Size = new System.Drawing.Size(470, 82);
			this.gbOption.TabIndex = 102;
			this.gbOption.TabStop = false;
			this.gbOption.Text = "选项设置";
			// 
			// btnOutPath
			// 
			this.btnOutPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btnOutPath.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnOutPath.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.btnOutPath.Location = new System.Drawing.Point(442, 58);
			this.btnOutPath.Name = "btnOutPath";
			this.btnOutPath.Size = new System.Drawing.Size(24, 21);
			this.btnOutPath.TabIndex = 13;
			this.btnOutPath.Text = "...";
			this.btnOutPath.Click += new System.EventHandler(this.btnOutPath_Click);
			// 
			// lbOutPath
			// 
			this.lbOutPath.Location = new System.Drawing.Point(5, 62);
			this.lbOutPath.Name = "lbOutPath";
			this.lbOutPath.Size = new System.Drawing.Size(55, 13);
			this.lbOutPath.TabIndex = 11;
			this.lbOutPath.Text = "输出路径:";
			// 
			// btnInFile
			// 
			this.btnInFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btnInFile.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnInFile.Location = new System.Drawing.Point(442, 36);
			this.btnInFile.Name = "btnInFile";
			this.btnInFile.Size = new System.Drawing.Size(24, 21);
			this.btnInFile.TabIndex = 12;
			this.btnInFile.Text = "...";
			this.btnInFile.Click += new System.EventHandler(this.btnInFile_Click);
			// 
			// lbInFile
			// 
			this.lbInFile.Location = new System.Drawing.Point(5, 40);
			this.lbInFile.Name = "lbInFile";
			this.lbInFile.Size = new System.Drawing.Size(55, 13);
			this.lbInFile.TabIndex = 9;
			this.lbInFile.Text = "源 文 件:";
			// 
			// cbTestProject
			// 
			this.cbTestProject.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.cbTestProject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbTestProject.ItemHeight = 12;
			this.cbTestProject.Items.AddRange(new object[] {
															   "Microsoft Office Word",
															   "Microsoft Office PowerPoint",
															   "Microsoft Office Excel"});
			this.cbTestProject.Location = new System.Drawing.Point(60, 14);
			this.cbTestProject.Name = "cbTestProject";
			this.cbTestProject.Size = new System.Drawing.Size(290, 20);
			this.cbTestProject.TabIndex = 1;
			this.cbTestProject.SelectedIndexChanged += new System.EventHandler(this.cbTestProject_SelectedIndexChanged);
			// 
			// lbTestProject
			// 
			this.lbTestProject.Location = new System.Drawing.Point(5, 16);
			this.lbTestProject.Name = "lbTestProject";
			this.lbTestProject.Size = new System.Drawing.Size(55, 14);
			this.lbTestProject.TabIndex = 0;
			this.lbTestProject.Text = "生成项目:";
			this.lbTestProject.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lvFileList
			// 
			this.lvFileList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.lvFileList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
																						 this.cHID,
																						 this.cHFileName,
																						 this.cHPassWord});
			this.lvFileList.FullRowSelect = true;
			this.lvFileList.GridLines = true;
			this.lvFileList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
			this.lvFileList.HideSelection = false;
			this.lvFileList.Location = new System.Drawing.Point(3, 14);
			this.lvFileList.MultiSelect = false;
			this.lvFileList.Name = "lvFileList";
			this.lvFileList.Size = new System.Drawing.Size(464, 292);
			this.lvFileList.TabIndex = 109;
			this.lvFileList.View = System.Windows.Forms.View.Details;
			// 
			// cHID
			// 
			this.cHID.Text = "ID";
			this.cHID.Width = 30;
			// 
			// cHFileName
			// 
			this.cHFileName.Text = "文件位置";
			this.cHFileName.Width = 320;
			// 
			// cHPassWord
			// 
			this.cHPassWord.Text = "密码";
			this.cHPassWord.Width = 90;
			// 
			// gbFileList
			// 
			this.gbFileList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.gbFileList.Controls.Add(this.lvFileList);
			this.gbFileList.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.gbFileList.Location = new System.Drawing.Point(2, 86);
			this.gbFileList.Name = "gbFileList";
			this.gbFileList.Size = new System.Drawing.Size(470, 310);
			this.gbFileList.TabIndex = 112;
			this.gbFileList.TabStop = false;
			this.gbFileList.Text = "文件列表";
			// 
			// FormPrepare
			// 
			this.AcceptButton = this.btnExecute;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.CancelButton = this.btnExit;
			this.ClientSize = new System.Drawing.Size(474, 424);
			this.Controls.Add(this.gbFileList);
			this.Controls.Add(this.gbOption);
			this.Controls.Add(this.btnExit);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.btnExecute);
			this.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.MinimizeBox = false;
			this.MinimumSize = new System.Drawing.Size(482, 458);
			this.Name = "FormPrepare";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "测试准备";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Resize += new System.EventHandler(this.FormExecute_Resize);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.FormExecute_Closing);
			this.Load += new System.EventHandler(this.FormExecute_Load);
			this.gbOption.ResumeLayout(false);
			this.gbFileList.ResumeLayout(false);
			this.ResumeLayout(false);

		}
        #endregion

        #region 主界面事件
        /// <summary>
        /// 执行按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExecute_Click(object sender, System.EventArgs e)
        {
            this.btnExecute.Enabled = false;
            this.btnExit.Enabled = false;
            this.btnInFile.Enabled = false;
            this.btnOutPath.Enabled = false;
            this.btnSave.Enabled = false;
            this.MdiParent.WindowState = FormWindowState.Minimized;
			m_pCapEx = new CaptureException(Path.GetDirectoryName(Application.ExecutablePath) + @"\CapExCfg.ini",
				m_strOutPath + @"Capture\");
			switch(this.cbTestProject.SelectedIndex)
            {
            	case 0:
                    WORDPasswordTest();
                    break;
            	case 1:
					PPTPasswordTest();
            		break;
                case 2:
                    EXCELPasswordTest();
                    break;
                default:
                    WORDPasswordTest();
                    break;
            }
			UpdateFileList();
        }
        /// <summary>
        /// 保存按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            SaveConfig();
        }
        /// <summary>
        /// 退出按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExit_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }
        /// <summary>
        /// 输入源文件更改事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtInFile_TextChanged(object sender, System.EventArgs e)
        {
            m_strInFile = this.txtInFile.Text;
        }
        /// <summary>
        /// 输出路径更改事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtOutPath_TextChanged(object sender, System.EventArgs e)
        {
            m_strInPath = this.txtOutPath.Text;
        }
        /// <summary>
        /// 输入源文件按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnInFile_Click(object sender, System.EventArgs e)
        {
			string _strTmp = this.txtInFile.Text;
			if(!_strTmp.Equals(""))
			{
				// 变换该路径中的Today和Yesterday关键字为相应的日期 [12/24/2004]
				_strTmp = IOIntegrate.GetDateKeyWord(_strTmp);
				if(File.Exists(_strTmp))
				{
					this.OFDlgFiles.InitialDirectory = Path.GetDirectoryName(_strTmp);
					this.OFDlgFiles.FileName = String.Empty;
				}
				else
				{
					_strTmp = Path.GetDirectoryName(_strTmp);
					if(Directory.Exists(_strTmp))
					{
						this.OFDlgFiles.InitialDirectory = _strTmp;
						this.OFDlgFiles.FileName = String.Empty;
					}

⌨️ 快捷键说明

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