Mobile phone number batch import

xiaoxiao2021-03-30  259

Using system.drawing; using system.collections; using system.windows.form; using system.data; using system.data.sqlclient;

A summary description of Namespace SMSphone {///

/// form1. /// public class Form1: System.Windows.Forms.Form {private System.Windows.Forms.Button button1; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox textBox5; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label7; private System.Windows.Forms.Button button2; private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.TextBox textBox7; / // /// The required designer variable. /// private system.componentmodel.container component = null; private system.windows.forms.label label8; private system.windows.Forms.Label label9;

Public SqlConnection Conn; Public Form1 () {// // Windows Form Designer Support for // InitializationComponent ();

// // Todo: Add any constructor code after INITIALIZEComponent call //}

///

/// Clean all the resources being used. /// Protected Override Void Dispose (Bool Disposing) {if (disponents! = Null) {components.dispose ();}} Base.Dispose

#REGION Windows Form Designer The code ///

/// designer supports the required method - do not use the code editor to modify the // / this method.

/// private void initializecomponent () {this.button1 = new system.windows.Forms.Button (); this.textbox1 = new system.windows.forms.textbox (); this.label1 = new system. Windows.Forms.Label (); this.groupBox1 = new system.windows.forms.groupbox (); this.label9 = new system.windows.forms.label (); this.label3 = new system.windows.forms.label (); This.TextBox3 = new system.Windows.Forms.TextBox (); this.textbox2 = new system.windows.Forms.TextBox (); this. groupBox2 = new System.Windows.Forms.GroupBox (); this.label8 = new System.Windows.Forms.Label (); this.textBox7 = new System.Windows.Forms.TextBox (); this.textBox6 = new System. Windows.Forms.TextBox (); this.button2 = new system.windows.Forms.Button (); this.label7 = new system.windows.forms.label (); this.label6 = new system.windows.forms.label (); This.TextBox5 = new system.windows.Forms.TextBox (); this.label5 = new system.windows.forms.label (); this .label4 = new System.Windows.Forms.Label (); this.textBox4 = new System.Windows.Forms.TextBox (); this.groupBox1.SuspendLayout (); this.groupBox2.SuspendLayout (); this.SuspendLayout () ; // // button1 // this.button1.location = new system.drawing.point (160, 48); this.button1.name = "button1"; this.button1.tabindex = 0; this.button1.text = "Batch import"; this.button1.click = new system.eventhandler (this.button1_click); /// textBox1 // this.textbox1.location = new system.drawing.point (16, 48); this.TextBox1 .Name = "textbox1"; this.TextBox1.tabindex = 1;

This.TextBox1.text = "133699"; // // label1 // this.label1.Location = new system.drawing.point (8, 24); this.label1.name = "label1"; this.label1.size = new system.drawing.size (136, 16); this.label1.tabindex = 2; this.label1.text = "Please enter the first 7 digits of the mobile phone number:"; //. Groupbox1 // this.groupBox1. Controls.add (this.label9); this.groupbox1.controls.add (this.label3); this.groupBox1.controls.add (this.label2); this.groupBox1.controls.add (THIS.TEXTBOX3); this. Groupbox1.controls.add (this.textBox2); this.groupBox1.controls.add (this.label1); this.groupBox1.controls.add (this.textBox1); this.groupBox1.controls.add (this.button1); This.GroupBox1.Location = new system.drawing.point (8, 200); this.groupbox1.name = "groupbox1"; this.groupBox1.size = new system.drawing.size (280, 168); this.groupbox1. Tabindex = 3; this.groupbox1.tabstop = false; this.groupbox1.text = "Mobile phone number Batch Import"; // // Label9 // this.label9.forecolor = system.drawing.systemcolors.activeCAption; THISLABEL9.LOCATION = New System.drawing.Point (16, 136); this.label9.name = "label9"; this.label9.size = new system.drawing.size (240, 23); this.label9. Tabindex = 7; // // label3 // this.label3.Location = new system.drawing.point (128, 112); this.label3.name = "label3"; this.label3.size = new system.drawing. Size (16, 23); this.label3.tabindex = 6; this.label3.text = "-"; /// Label2 // this.label2.location = new system.drawing.point (8, 80); THIS.Label2.name = "label2"; this.label2.size = new system.drawing.size (128, 16);

THIS.Label2.tabindex = 5; this.label2.text = "After entering 4 digits:"; //////// TEXTBOX3 // this.TextBox3.Location = new system.drawing.point (144, 104); THISTBOX3.NAME = "textBox3"; this.textBox3.tabindex = 4; this.textBox3.text = "3"; /// textbox2 // this.textBox2.Location = new system.drawing.point (16, 104); this.TextBox2.name = "textbox2"; this.textbox2.size = new system.drawing.size (104, 21); this.textbox2.tabindex = 3; this.TextBox2.text = "0"; / / // groupt2.controls.add (this.label8); this.groupbox2.controls.add (this.textbox7); this.groupBox2.controls.add (this.textbox6); this.groupBox2.controls .Add (this.button2); this.groupbox2.controls.add (this.label7); this.groupbox2.controls.add (this.label6); this.groupBox2.controls.add (this.textbox5); this.groupBox2 .Controls.add (this.label5); this.groupBox2.controls.add (this.label4); this.groupBox2.controls.add (this.TextBox4); this.groupbox2.location = new system.drawi Ng.Point (8, 16); this.groupBox2.name = "groupbox2"; this.groupbox2.size = new system.drawing.size (280, 168); this.groupbox2.tabindex = 4; this.groupBox2.tabstop = false; this.groupbox2.text = "database information"; // // label8 // this.label8.location = new system.drawing.point (120, 136); this.label8.name = "label8"; this .label8.size = new system.drawing.size (120, 23); this.label8.tabindex = 9; /// textBox7 // this.TextBox7.Location = new system.drawing.point (136, 104); This.TextBox7.name = "textbox7"; this.TextBox7.tabindex = 8;

This.TextBox7.text = "sa"; // // textbox6 // this.textbox6.location = new system.drawing.point (8, 104); this.textbox6.name = "textbox6"; this.TextBox6.tabindex = 7; this.TextBox6.text = "sa"; // // button2 // this.button2.location = new system.drawing.point (8, 136); this.button2.name = "button2"; this. Button2.tabindex = 6; this.button2.text = "Test connection"; this.button2.click = new system.eventhandler (this.button2_click); // // label7 // this.label7.location = new system. Drawing.Point (136, 80); this.label7.name = "label7"; this.label7.size = new system.drawing.size (100, 16); this.label7.tabindex = 5; this.label7.text = "Password:"; // // label6 // this.label6.location = new system.drawing.point (8, 80); this.label6.name = "label6"; this.label6.size = new system. Drawing.size (100, 16); this.label6.tabindex = 4; this.label6.text = "User Name:"; /// TEXTBOX5 // this.textBox5.Location = new system.drawing.point (136 , 48); TextBox5.name = "textbox5"; this.textbox5.tabindex = 3; this.textBox5.text = "USM_SGIP"; // // label5 // this.label5.location = new system.drawing.point (136, 24) This.Label5.Name = "label5"; this.label5.size = new system.drawing.size (96, 16); this.label5.tabindex = 2; this.label5.text = database name: "; / / // label4 // this.label4.location = new system.drawing.point (8, 24); this.label4.name = "label4"; this.label4.size =

New system.drawing.size (88, 16); this.label4.tabindex = 1; this.label4.text = "server name:"; /// textBox4 // this.TextBox4.Location = new system.drawing. Point (8, 48); this.TextBox4.name = "textbox4"; this.textBox4.tabindex = 0; this.textBox4.text = "user-41v1a4ikrt // Bulbul"; /// Form1 // this.autoscalebasesize = new system.drawing.size (6, 14); this.clientsize = new system.drawing.size (296, 373); this.Controls.add (this.groupBox2); this.controls.add (this.groupbox1) This.name = "form1"; this.text = "Mobile phone number batch import system"; this.Load = new system.eventhandler (this.form1_load); this.groupBox1.ResumeLayout (false); this.groupbox2.ResumeLayout; THISE (False); this.ResumeLayout (false);} #ENDREGION

///

/// The primary entry point of the application. /// [stathread] static void main () {Application.run (new form1 ());} private void form1_load (Object sender, system.eventargs e) {}

private void button2_Click (object sender, System.EventArgs e) {// database address string Dbserver = this.textBox4.Text; // Name of the database string Dbase = this.textBox5.Text; // database user name string DbUserId = this.textBox6 .Text; // database password string dbuserpsw = this.textBox7.text; // Connect database string string sqlconn = "server =" dbserver "; dataBase =" dbase "; uid =" dbuserid "; PWD = " DBUSERPSW " "" "; sqlConnection conn = new sqlConnection (SQLCONN); if (conn.state == connectionState.closed) {conn.open (); this.Label8.text =" Database connection success! ";} Else {this.label8.text = "Database connection failed to check your input!";}} private void button1_click (object sender, system.eventargs e) {INT i; string strsql; // database address string dbserver = this. TextBox4.text; // Database Name String DBASE = this.textBox5.text; // Database User Name String Dbuserid = this.textBox6.text; // Database Code String Dbuserpsw = this.textBox7.text; // Number String Forward = this.TextBox2.text; string back = this.textbox3.tex T;

转载请注明原文地址:https://www.9cbs.com/read-130732.html

New Post(0)