SqlConnection cn = new SqlConnection(); 
            cn.ConnectionString = "Data Source=192.168.16.71;Initial Catalog=myWork;User ID=sa;Password=sa";
           
            try
            {
                cn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = cn;
               
                string sql2 = "select * from dbo.工作微博 where 姓名='" + this.textBox1.Text + "' and 密码='" + this.textBox2.Text + "'";
                cmd.CommandText = sql2; 
                cmd.CommandType = CommandType.Text;
                SqlDataReader reader = cmd.ExecuteReader();
                if (reader.Read()) //如果找到用户信息,说明登录成功
                {

switch ("select 权限 from dbo.工作微博 where 姓名='" + this.textBox1.Text + "'")
                    { 
                        case"0":
                            Form2 newForm = new Form2();

newForm.Show(); //弹出主窗体

break;
                        case "1":
                            Form3 f3 = new Form3();

f3.Show(); //弹出主窗体

break;
                        case "2":
                            Form1 f1 = new Form1();
                            f1.Show(); //弹出主窗体
                            break;

}

最新文章

  1. 64位win7硬盘安装64位ubuntu 13.04
  2. silverlight 富文本
  3. R %operator% 含义
  4. 百度,人人,新浪,腾讯等分享Js代码
  5. libvirtVirsh
  6. 测试class
  7. javascript常见面试题
  8. Windows XP Mode安装
  9. pod command
  10. B. Vova and Trophies 字符串预处理+思维+贪心
  11. .NetCore WebApi
  12. transitionEnd不起作用解决方法
  13. HNUOJ 13341
  14. python3中 getpass模块使用
  15. vue组件+axios访问本地json
  16. Azure Messaging-ServiceBus Messaging消息队列技术系列2-编程SDK入门
  17. vs2015 编译google v8
  18. $.extend与$.fn.extend()
  19. 在CentOS7上部署 Kubernetes集群
  20. 安装好XAMPP+安装好PhpStorm 然后搭建PHP开发环境

热门文章

  1. mysql的limit经典用法及优化
  2. 推荐一个有趣的软件"Process Monitor"
  3. 深入了解使用egret.WebSocket
  4. MongoDB-固定集合 capped collection 操作 介绍
  5. jquery ajax (2)实例 .GET
  6. 阻塞和非阻塞socket的区别
  7. 快速排序(Quick Sort)的C语言实现
  8. zend framework 1 连接oracle数据库的写法
  9. web client
  10. -_-#【AJAX】XMLHttpRequest