Lib New
gacutil /if E:\ThirdParty\RockyLib\Rocky\bin\Release\Rocky.dll
gacutil /u Rocky
partial class GmailForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (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.groupBox1 = new System.Windows.Forms.GroupBox();
this.button3 = new System.Windows.Forms.Button();
this.txtPwd = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.txtKey = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button3);
this.groupBox1.Controls.Add(this.txtPwd);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Location = new System.Drawing.Point(, );
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(, );
this.groupBox1.TabIndex = ;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Encrypt";
//
// button3
//
this.button3.Location = new System.Drawing.Point(, );
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(, );
this.button3.TabIndex = ;
this.button3.Text = "Send";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// txtPwd
//
this.txtPwd.Location = new System.Drawing.Point(, );
this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '囧';
this.txtPwd.Size = new System.Drawing.Size(, );
this.txtPwd.TabIndex = ;
//
// button2
//
this.button2.Location = new System.Drawing.Point(, );
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(, );
this.button2.TabIndex = ;
this.button2.Text = "EncryptOutFilePath";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(, );
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(, );
this.button1.TabIndex = ;
this.button1.Text = "EncryptInFilePath ";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Controls.Add(this.button4);
this.groupBox2.Controls.Add(this.txtKey);
this.groupBox2.Location = new System.Drawing.Point(, );
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(, );
this.groupBox2.TabIndex = ;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Decrypt";
//
// button6
//
this.button6.Location = new System.Drawing.Point(, );
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(, );
this.button6.TabIndex = ;
this.button6.Text = "Decrypt";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button5
//
this.button5.Location = new System.Drawing.Point(, );
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(, );
this.button5.TabIndex = ;
this.button5.Text = "DecryptOutFilePath";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(, );
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(, );
this.button4.TabIndex = ;
this.button4.Text = "DecryptInFilePath ";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// txtKey
//
this.txtKey.Location = new System.Drawing.Point(, );
this.txtKey.Name = "txtKey";
this.txtKey.Size = new System.Drawing.Size(, );
this.txtKey.TabIndex = ;
//
// GmailForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "GmailForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "GmailHepler";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false); } #endregion private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
private System.Windows.Forms.TextBox txtPwd;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtKey;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button5; }
GmailForm.Designer.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net; namespace Rocky.App
{
public partial class GmailForm : Form
{
long splitLength = 1024L * 1024L * 20L; public GmailForm()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
} private void button2_Click(object sender, EventArgs e)
{
folderBrowserDialog1.ShowDialog();
} private void button3_Click(object sender, EventArgs e)
{
string inFilePath = openFileDialog1.FileName, outFolderPath = folderBrowserDialog1.SelectedPath;
if (!string.IsNullOrEmpty(txtPwd.Text) && !string.IsNullOrEmpty(inFilePath) && !string.IsNullOrEmpty(outFolderPath))
{
string fileName = Path.GetFileName(inFilePath);
string encryptInFilePath = inFilePath,
encryptOutFilePath = Path.Combine(outFolderPath, fileName);
CryptoManaged c = new CryptoManaged(string.Empty);
c.EncryptFile(encryptInFilePath, encryptOutFilePath, splitLength, SplitFileMode.InputFileLength);
var gmail = new MailClient();
gmail.Config(MailClient.SystemMail.Gmail, txtPwd.Text);
//gmail.Priority = System.Net.Mail.MailPriority.High;
gmail.SetBody("Key 4 EncryptLib.", c.Key + "," + c.IV, Directory.GetFiles(outFolderPath, fileName + "_Part*.temp"));
gmail.AddTo("ilovehaley.kid@gmail.com", string.Empty);
try
{
txtPwd.ReadOnly = false;
gmail.Send();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
txtPwd.ReadOnly = true;
Console.WriteLine("SendCompleted.");
}
}
} private void button4_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
} private void button5_Click(object sender, EventArgs e)
{
folderBrowserDialog1.ShowDialog();
} private void button6_Click(object sender, EventArgs e)
{
string inFilePath = openFileDialog1.FileName, outFolderPath = folderBrowserDialog1.SelectedPath;
if (!string.IsNullOrEmpty(txtKey.Text) && !string.IsNullOrEmpty(inFilePath) && !string.IsNullOrEmpty(outFolderPath))
{
string temp = Path.GetFileNameWithoutExtension(inFilePath);
temp = temp.Remove(temp.IndexOf("_"));
string fileName = temp + Path.GetExtension(inFilePath);
string[] keys = txtKey.Text.Split(',');
CryptoManaged c = new CryptoManaged(keys[], keys[]);
string decryptOutFilePath = Path.Combine(outFolderPath, "D_" + fileName);
c.DecryptFile(Path.GetDirectoryName(inFilePath) + fileName, decryptOutFilePath, splitLength, SplitFileMode.InputFileLength);
}
}
}
}
GmailForm
Lib New的更多相关文章
- 新手,Visual Studio 2015 配置Boost库,如何编译和选择,遇到无法打开文件“libboost_thread-vc140-mt-gd-1_63.lib“的解决办法
1,到官网下载最新的boost,www.boost.org 这里我下载的1-63版本. 2,安装,解压后运行bootstrap.bat文件.稍等一小会就OK. 3,编译boost库.注意一定要使用VS ...
- ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock
ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock 通过终端安装程序sudo apt-get install xxx时出错:E: Could not ...
- OSG3.40 编译时,无法打开输入文件“optimized.lib”
解决方案: 正常情况下,下图中会多出一项:ZLIB_LIBRARY_RELEASE,之后屡次编译,都提示"无法打开输入文件"optimized.lib"" 因为 ...
- Eclipse部署Maven web项目到tomcat服务器时,没有将lib下的jar复制过去的解决办法
我们在做web开发是,经常都要在eclipse中搭建web服务器,并将开发中的web项目部署到web服务器进行调试,在此,我选择的是tomcat服务器.之前部署web项目到tomcat进行启动调试都很 ...
- 解决VS2015安装后stdio.h ucrtd.lib等文件无法识别问题
今天突然想在windows上装个 VS2015 玩玩,结果遇到了如下bug:安装完 VS2015 后,直接新建项目->win32控制台->运行,结果报错!"无法打开包括文件: & ...
- locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory
# locate zabbix locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory locate ...
- 通过dll或def文件提取lib导入库文件
很多时候第三方库或其他项目提供的库多数会以动态库的形式提供dll以及相应的lib导入库.头文件,不过也有的只是提供dll和头文件,或者也提供了def模块定义(用于导出函数)文件,此时若使用将不得不调用 ...
- make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl] 错误 1,make: *** [out/host/linux-x86/obj/lib/libESR_Portable.so] 错误 1
错误3: g++: g++: selected multilib '32' not installed selected multilib '32' not installed make: *** [ ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...
- 缺少.lib文件导致的Link2019 解决方案汇总
环境Vs2015, Win10 添加lib的方法在末尾 下面的错误都是我在写Direct3D程序中遇到的, 记下来方便查找 4.ws2_32.lib 3. version.lib _GetFil ...
随机推荐
- gevent中如何实现长轮询
浏览网页时,浏览器会传HTTP 请求到服务器,服务器会根据请求将网页的内容传给浏览器,但是在很多的情况下,使用者会需要看到最新的即时性资讯,例如观看股票市场行情,而在以前只能靠着重新载入网页才能获得最 ...
- ios CoreBluetooth 警告 is being dealloc'ed while pending connection
ios CoreBluetooth 警告 is being dealloc'ed while pending connection CoreBluetooth[WARNING] <CBPerip ...
- HTTP请求415错误 – 不支持的媒体类型(Unsupported media type)
HTTP请求415错误 – 不支持的媒体类型(Unsupported media type) 通常有以下情况: 1:检查你的 http 请求头信息,比如 因为 User-Agent 被服务器设置 拒绝 ...
- DEDE首页会员部分,后台登陆,会员登录相关页面
首页会员涉及部分 \templets\default\style\page.css \member\ajax_loginsta.php 会员登录页面涉及部分 \member\templets\inde ...
- mydbtest文档
mydbtest是楼方鑫编写的一个数据库测试工具,有需要的话,请自取 http://pan.baidu.com/s/1mgJpukg#path=%252FOneSQL%252FDocument 找到& ...
- 客户端ARPG角色行为模型
[概述] 对于玩家自身而言, 场景中的角色分两种:自己,别的生物(包括别的玩家,monster, npc等).而生物本身是一个集合{属性数据(状态), 行为(动作表现)}. 站在玩家自身的角度来看, ...
- C++从键盘输入文件结束符
当我们使用一个istream对象作为条件时,其效果是检测流的状态.如果流是有效的,即流未遇到错误,那么检测成功.当遇到文件结束符,或遇到一个无效输入时(例如需要将输入读到一个int变量 ...
- C语言中随机数相关问题
用C语言产生随机数重要用到rand函数.srand函数.及宏RAND_MAX(32767),它们均在stdlib.h中进行了声明. int rand(void);//生成一个随机数 voidsrand ...
- Java Swing事件处理机制
Java Swing的事件处理机制 Swing GUI启动后,Java虚拟机就启动三个线程,分别为主线程,事件派发线程(也是事件处理线程)和系统工具包线程. 主线程 :负责创建并显示该程序的初始界面: ...
- (26)odoo中的序列运用
* 模块中增加序列 __openerp__.py : ... 'data': [ 'product_data.xml', ], ... ------ ...