using System; using System.Drawing; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Configuration; using System.Windows.Forms; using System.Data;
Namespace Datalibrary {///
///
// // TODO: added after InitializeComponent call any constructor code // string SystemDir = System.Environment.SystemDirectory; DisposalConductService1 = new DisposalConductService (SystemDir "// CBERP_Dis.DLL"); this.textBox1.Text = DisposalConductService1.GetValue ("Servername", ""). Tostring (); this.textbox2.text = disposalconductService1.getValue ("sqlaccount", "sa"). Tostring (); this.textBox3.text = disposalconductService1.getValue (" Password "," jiayu520 "). TOSTRING (); this.textBox5.text = this.textBox3.text; this.textbox4.text = disposalconductService1.getValue (" Database "," cberp "). Tostring ();} // /
#Region Design Interface Generation Code ///
/// summary> private (this.closebutton = new system.windows.forms.button (); this.label1 = new system.windows.forms.label (); this.label2 = new system. Windows.Forms.Label (); this.label3 = new system.windows.forms.label (); this.label4 = new system.windows.forms.label (); this.textbox1 = new system.windows.Forms.TextBox (); This.textBox2 = new system.windows.forms.textbox (); this.textbox3 = new system.windows.forms.textbox (); this.textbox4 = new system.windows.Forms.TextBox (); this. Button1 = new system.windows.Forms.Button (); this.textbox5 = new system.windows.forms.textbox (); this.label5 = new system.windows.forms.label (); this.suspendlayout (); / / // closebutton // this.closebutton.location = new system.drawing.point (277, 92); this.closebutton.name = "closebutton"; this.closebutton.size = new system.drawing.size (66, 25 ); This.closebutton.tabindex = 7; this.closebutton.text = "Close"; this.closebutton.click = new sys Tem.EventHandler (this.closebutton_click); /// Label1 // this.label1.autosize = true; this.label1.location = new system.drawing.point (12, 16); this.label1.name = "Label1 "; This.label1.size = new system.drawing.size (66, 17); this.label1.tabindex = 4; this.label1.text =" server name: "; /// label2 // this.label2 .Autosize = true; this.label2.location = new system.drawing.point (18, 43); this.label2.name = "label2"; this.label2.size = new system.drawing.size (60, 17) This.label2.tabindex = 4; this.label2.text = "SQL account:";
/// label3 // this.label3.autosize = true; this.label3.Location = new system.drawing.point (18, 70); this.label3.name = "label3"; this.label3.size = new System.drawing.size (60, 17); this.label3.tabindex = 4; this.label3.text = "SQL password:"; // // label4 // this.label4.autosize = true; this.label4. Location = new system.drawing.point (12, 124); this.label4.name = "label4"; this.label4.size = new system.drawing.size (66, 17); this.label4.tabindex = 4; This.label4.text = "Database Name:"; // // textBox1 // this.textBox1.Location = new system.drawing.point (102, 14); this.textbox1.name = "textbox1"; this.TextBox1 .Size = new system.drawing.size (162, 21); this.textBox1.tabindex = 1; this.textBox1.text = ""; /// textbox2 // this.textbox2.location = new system.drawing. Point (102, 41); this.TextBox2.name = "textBox2"; this.textbox2.size = new system.drawing.size (162, 21); this.textbox2.tabindex = 2; this.TextBox2.text = " "// // t ExtBox3 // this.textbox3.location = new system.drawing.point (102, 68); this.textbox3.name = "textbox3"; this.textbox3.passwordchar = '*'; this.TextBox3.size = new system. Drawing.size (162, 21); this.textBox3.Tabindex = 3; this.textBox3.text = ""; /// textbox4 // this.textbox4.location = new system.drawing.point (102, 122) This.TextBox4.name = "textbox4"; this.textbox4.size = new system.drawing.size (162, 21); this.TextBox4.TabINDEX = 5; this.TextBox4.text = ""
// // button1 // this.button1.location = new system.drawing.point (277, 46); this.button1.name = "button1"; this.button1.size = new system.drawing.size (66, 26); this.button1.tabindex = 6; this.button1.text = "save"; this.button1.click = new system.eventhandler (this.button1_click); //// textbox5 // this.textbox5.location = new system.drawing.point (102, 95); this.textBox5.name = "textbox5"; this.textbox5.passwordchar = '*'; this.textbox5.size = new system.drawing.size (162, 21) "This.TextBox5.tabindex = 4; this.textbox5.text =" "; /// label5 // this.label5.location = new system.drawing.point (12, 97) This.Label5.name = "label5"; this.label5.size = new system.drawing.size (66, 17); this.label5.Tabindex = 4; this.Label5.text = "Confirm Password:"; / / // disposalconductuct // this.acceptButton = this.button1; this.autoscalebasesize = new system.drawing.size (6, 14); this.clientsize = new system.drawing.size 355, 157); this.Controls.add (this.button1); this.Controls.add (this.TextBox1); this.Controls.add (this.TextBox2); this.Controls.add (this.TextBox3); this. .Controls.add (this.textbox4); this.Controls.add (this.TextBox5); this.controls.add (this.label1); this.controls.add (this.closebutton); this.controls.add (This.Add (this .label2); this.controls.add (this.label3); this.controls.add (this.label4); this.controls.add (this.Label5); this.formorderstyle = system.Windows.Forms.FormBorderstyle.FixedDialog This.maximizebox = false; this.minimizebox = false; this.name =
"Disposalconduct"; this.showintaskbar = false; this.startPosition = system.windows.forms.formstartPosition.centerscreen; this.text = "Running environment settings"; this.ResumeLayout (false);} #ENDREGION
Private void closebutton_click (object sender, system.eventargs e) {this.close (); this.dispose ();
private void button1_Click (object sender, System.EventArgs e) {if (this.textBox3.Text = this.textBox5.Text!) MessageBox.Show ( "different password and confirmation!"); else {this.DisposalConductService1.UpdateValue ( "ServerName", this.textBox1.Text); this.DisposalConductService1.UpdateValue ( "SqlAccount", this.textBox2.Text); this.DisposalConductService1.UpdateValue ( "PassWord", this.textBox3.Text); this.DisposalConductService1.UpdateValue ( "DataBase", this.textBox4.Text); MessageBox.Show ( "save settings successfully!"); DataLibrary.SqlConnect sqlconn = new SqlConnect (); sqlconn.ConnString = "server =" DisposalConductService1.GetValue ( "ServerName" "(local)") "; user id =" DisposalconductService1.getValue ("SQLACCOUNT", "SA") "; password =" DisposalconductService1.GetValue ("Password", "jiayu520") "; dataBase = " DisposalconductService1.GetValue (" Database "," cberp ");}}}}