试读部分
目录 1、通用代码介绍 1)C#使用MySQL 2)跳转界面 3)字符串转变为数值(str转换为int) 2、登录界面设计 1)界面图片 (Form1 ) 2)代码 3、用户注册界面设计 1)界面图片(Form2) 2)代码 4、管理员注册界面设计 1)界面图片(Form3) 2)代码 5、用户查询图书界面设计 1)界面图形(Form4) 2)代码 6、管理员管理图书界面设计 1)界面设计(Form5) 2)代码 7、系统网盘地址 1、通用代码介绍 1)C#使用MySQL 使用using来调用mysql连接 using MySql.Data.MySqlClient;
连接数据库Book string strcon = "Database=Book;Data Source=localhost;User Id=root;Password=123456";//连接数据库的参数
MySqlConnection mysqlcon = new MySqlConnection(strcon);//连接数据库
mysqlcon.Open();
参数含义: 【Data Source】 :服务器IP地址 【Database】: 数据库名称 【User Id】 :数据库用户名 【Password】: 数据库密码 2)跳转界面 本界面跳转到Form1界面 new Form1().Show();//Form1显示
this.Hide();//本界面隐藏
3)字符串转变为数值(str转换为int) 将txtprice.Text的字符串转变为int型赋值到num int num ;
int.TryParse(txtprice.Text, out num);
2、登录界面设计 1)界面图片 (Form1 ) 2)代码 public partial class F……
本文为 VIP 文章,已展示部分内容,开通 VIP 后查看全文
觉得这篇文章有帮助?
点个赞,或赞赏支持作者持续创作