PetShop2.0中的加密与解密问题 PetShop3已经自带了个加密解密的PetShop.Utility.dll,你利用这个PetShop.Utility.dll就可以生成数据库连接串PetShop2的数据库连接串是没有加密的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using PetShop;using PetShop.Utility;namespace connstrForMSpetshop{ /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.TextBox textBox2; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <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.textBox1 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.textBox2 = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(8, 8); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(480, 80); this.textBox1.TabIndex = 0; this.textBox1.Text = ""; // // button1 // this.button1.Location = new System.Drawing.Point(496, 16); this.button1.Name = "button1"; this.button1.TabIndex = 1; this.button1.Text = "加 密"; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(496, 64); this.button2.Name = "button2"; this.button2.TabIndex = 2; this.button2.Text = "解 密"; this.button2.Click += new System.EventHandler(this.button2_Click); // // textBox2 // this.textBox2.Location = new System.Drawing.Point(8, 120); this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(480, 80); this.textBox2.TabIndex = 3; this.textBox2.Text = ""; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(584, 213); this.Controls.Add(this.textBox2); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.textBox1); this.Name = "Form1"; this.Text = "connstrForMSpetshop"; this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void button2_Click(object sender, System.EventArgs e) { string temp=textBox1.Text.Trim(); if(temp!="") { textBox2.Text=ConnectionInfo.DecryptDBConnectionString(temp); } } private void button1_Click(object sender, System.EventArgs e) { string temp=textBox1.Text.Trim(); if(temp!="") { textBox2.Text=ConnectionInfo.EncryptDBConnectionString(temp); } } }}//还需要手工引用你的PetShop.Utility.dll文件 若有什么疑问,可通过MSN告诉我,my MSN:[email protected] 多谢eheartcool(ced)。我试一下先。我说错了,我用的demo是PetShop3.0 建议你引用你的PetShop.Utility.dll,然后建个WINFORM(象我提供的CODE那样),就很方便来对数据库连接串做加密解密了,GOOD LUCK eheartcool(ced) 的建议不错,不知其它兄弟还有什么好的建议!欢迎各位评论 十分感谢eheartcool(ced)。散分!! 急!!!!!求教!!!TreeView问题 linq问题求助 如何将System.Drawing.Image保存到本地 upnp端口映射问题! 紧急求助 点群分布轴(直)线计算 c# 文本框中只允许输入半角数字 那位高手在使用waveInOpen&waveOutOpen时用过线程作回调使用,即使用CALLBACK_THREAD了参数?有c++的代码,但.net不知道怎么写? 注册表问题加C#程序设计问题 39码校驗位怎麼設置到39條碼中? crystalReport中怎么做这样的报表呀。请大家多多帮助啊 类里面再实例化自己是怎么回事?
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using PetShop;
using PetShop.Utility;namespace connstrForMSpetshop
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <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.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(8, 8);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(480, 80);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(496, 16);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "加 密";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(496, 64);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "解 密";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(8, 120);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(480, 80);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(584, 213);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "connstrForMSpetshop";
this.ResumeLayout(false); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
} private void button2_Click(object sender, System.EventArgs e)
{
string temp=textBox1.Text.Trim();
if(temp!="")
{
textBox2.Text=ConnectionInfo.DecryptDBConnectionString(temp);
}
} private void button1_Click(object sender, System.EventArgs e)
{
string temp=textBox1.Text.Trim();
if(temp!="")
{
textBox2.Text=ConnectionInfo.EncryptDBConnectionString(temp);
}
}
}
}//还需要手工引用你的PetShop.Utility.dll文件
我试一下先。我说错了,我用的demo是PetShop3.0
不知其它兄弟还有什么好的建议!
欢迎各位评论
散分!!