当前位置: 首页 > news >正文

大淘客网站logo怎么做网络营销策略方案

大淘客网站logo怎么做,网络营销策略方案,网站开发合同支付,网站制作合同非常简单,直接给出代码: 数据库操作类 这个无需多言就是简单的包含了数据操作的内容,允许你在这一个类中写完关于本地数据库或者云数据库操作的逻辑,与登录逻辑分开哦。 注意,如果你的软件要给别人运行使用&#xf…

非常简单,直接给出代码:

数据库操作类

这个无需多言就是简单的包含了数据操作的内容,允许你在这一个类中写完关于本地数据库或者云数据库操作的逻辑,与登录逻辑分开哦。

注意,如果你的软件要给别人运行使用,你的数据库信息也可以存在授权文件中,以避免出现信息的泄露。如果你使用软件直接操作数据库可能存在危险,请注意连接数据库时对sql语句的检查。

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace chuankouzhushou1
{internal class dataoperator{private static string connString = @"Data Source=DREAMER;Database=db_Mydb;User ID=sa;Pwd=yourpasswd;";public static SqlConnection connection = new SqlConnection(connString);public int ExecuteSQL(string sql){SqlCommand cmd = new SqlCommand(sql, connection);if (connection.State == ConnectionState.Closed)connection.Open();int num = Convert.ToInt32(cmd.ExecuteScalar());        //执行查询connection.Close();return num;}public int ExecuteSQLResult(string sql){SqlCommand cmd = new SqlCommand(sql, connection);if (connection.State == ConnectionState.Closed)connection.Open();int result = cmd.ExecuteNonQuery();connection.Close();return result;}public DataSet GetDataSet(string sql){SqlDataAdapter sqlda = new SqlDataAdapter(sql, connection);    //指定要执行的SQL语句DataSet ds = new DataSet();sqlda.Fill(ds);return ds;}public SqlDataReader GetDataReader(string sql){SqlCommand cmd = new SqlCommand(sql, connection);if (connection.State == ConnectionState.Closed)connection.Open();SqlDataReader dataReader = cmd.ExecuteReader();//添加参数CommandBehavior.CloseConnection就可以自动释放连接return dataReader;}}
}

输入的监测 

 private bool ValidateInput(){if (tx_ID.Text.Trim() == "")                            //登录账号{MessageBox.Show("请输入登录账号", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information);tx_ID.Focus();                                    //使登录账号文本框获得鼠标焦点return false;}else if (tx_ID.Text.Length>30){MessageBox.Show("请输入正确的登录账号", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information);tx_ID.Focus();                                    //使登录账号文本框获得鼠标焦点return false;}else if (tx_ID.Text.Length > 5 && tx_PWD.Text.Trim() == "")   //密码{MessageBox.Show("请输入密码", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information);tx_PWD.Focus();                                    //使密码文本框获得鼠标焦点return false;}return true;}

 登录按钮(回车实现登录)

private void loginbtn(object sender, EventArgs e){if(ValidateInput()){int num= 0;string sql = "select count(*) from usertb where userid=" + int.Parse(tx_ID.Text.Trim()) + " and userpwd = '" + tx_PWD.Text.Trim() + "'";try{num = dbop.ExecuteSQL(sql);}catch {//MessageBox.Show(e.ToString());}   if (num == 1)//验证通过{publicinfo.userid = int.Parse(tx_ID.Text.Trim());// 执行新的SQL查询来获取userid,username和userlvsql = "select userid, username, userlv from usertb where userid=" + publicinfo.userid;SqlDataReader reader = dbop.GetDataReader(sql);if (reader.Read()){publicinfo.userid = reader.GetInt32(0);publicinfo.username = reader.GetString(1);publicinfo.userlv = reader.GetInt32(2);}reader.Close();mainfrm frm_Main = new mainfrm();frm_Main.Show();this.Visible = false;}else{MessageBox.Show("登录失败!", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information);}}}private void tx_ID_KeyPress(object sender, KeyPressEventArgs e){if (char.IsDigit(e.KeyChar) || (e.KeyChar == '\r') || (e.KeyChar == '\b'))e.Handled = false;elsee.Handled = true;}

http://www.tj-hxxt.cn/news/97661.html

相关文章:

  • 张店网站建设哪家好文章优化关键词排名
  • 手机怎么做微电影网站体育热点新闻
  • 网站手机端页面怎么做的厦门seo搜索引擎优化
  • 做网站开发用哪种语言好什么是百度快照
  • 网站建设后的效果评估2022网站seo
  • 做国外网站建设域名备案官网
  • 清苑区建设网站找那家公司廊坊seo排名优化
  • 高端网站建设教学网站建设推广
  • 网站建设与制作德州seo优化网络
  • 废品回收在哪个网站做效果好seo免费诊断电话
  • 不良网站浏览窗口网站推广的10种方法
  • 公司手机网站模板互联网网络推广
  • 十个程序员必备的网站凡科网站建设
  • 页面设计制作网站源码北京百度seo排名点击器
  • 网站的ftp怎么查百度收录哪些平台比较好
  • 有做网站吗seo代码优化步骤
  • 网页设计于制作课程标准徐州自动seo
  • 如何查网站建设者ip如何制作网页广告
  • 河北pc端网站开发百度发布
  • 直播软件开发公司南宁百度seo排名价格
  • 自己做网站免费官方百度下载安装
  • 企业建站官网运营朋友圈广告投放
  • 做搜索网站app推广方法及技巧
  • 公司网站建设应注意西安网站建设制作
  • 网站咨询窗口怎么做超级外链工具 增加外链中
  • 美容院网站建设方案书策划网络营销活动
  • 安全可靠网站认证域名备案查询
  • 帝国网站模板建设完成显示不正常seo网络推广机构
  • 网站的建设与维护实践报告谷歌外贸seo
  • 哪里可以找到做网站的成都网站快速排名