• 大小: 115KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-08-01
  • 语言: C#
  • 标签: c#  

资源简介

c#+sqlserver编写的电费收费管理系统供需要使用,禁止盗权谢谢

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void radioButton1_CheckedChanged(object sender EventArgs e)
        {

        }

        private void button1_Click(object sender EventArgs e)
        {
            string s = ““;
            int ok =1;
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString =“ Data Source=DESKTOP-OA96K2A;Initial Catalog=课程设计;Integrated Security=True“;
            conn.Open();//连接数据库
            //管理员
            if (radioButton1.Checked)
            {
                s = “select * from Admin“;
                SqlCommand cmd = new SqlCommand(s conn);
                SqlDataReader dr = cmd.ExecuteReader();
                while(dr.Read())
                {
                    if (dr[0].ToString().Trim().Equals(textBox1.Text.Trim()) && dr[1].ToString().Trim().Equals(textBox2.Text.Trim()))//用户名和密码都正确
                  {
                    MessageBox.Show(“登录成功!“ “提示“);
                    ok = 0;
                   
                    Form2 f2 = new Form2();
                    f2.Show();

                  }
                }
                if(ok==1)
                {
                    MessageBox.Show(“密码或用户名错误!“ “提示“);
                    textBox1.Text = ““;
                    textBox2.Text = ““;
                    radioButton1.Checked = false;
                }
                dr.Close();
            }
            //普通用户
            if (radioButton2.Checked)
            {
                
                s = “select * from Yonghu“;
                SqlCommand cmd = new SqlCommand(s conn);
                SqlDataReader dr = cmd.ExecuteReader();
                
                while(dr.Read())
                {

                    if (dr[0].ToString().Trim().Equals(textBox1.Text.Trim()) && dr[1].ToString().Trim().Equals(textBox2.Text.Trim()))//用户名和密码都正确
                    {
                        MessageBox.Show(“登录成功!“ “提示“);
                        ok = 0;
                        Form3 f3 = new Form3();
                        f3.Show();
                        }
                }
                
               if(ok ==1)
                {
                    MessageBox.Show(“密码或用户名错误!“ “提示“);
                    textBox1.Text = ““;
                    textBox2.Text = ““;
                    radioButton2.Checked = false;
                }
            }

        }

        private void radioButton2_CheckedChanged(object sender EventArgs e)
        {

        }

        private void button2_Click(object sender

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-12-16 15:21  WindowsFormsApplication1\
     目录           0  2016-12-16 15:51  WindowsFormsApplication1\TestResults\
     目录           0  2016-12-16 11:53  WindowsFormsApplication1\WindowsFormsApplication1\
     文件         187  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\App.config
     文件          60  2016-12-09 19:15  WindowsFormsApplication1\WindowsFormsApplication1\ClassDiagram1.cd
     文件        7365  2016-12-13 22:26  WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
     文件        3526  2016-12-14 21:49  WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
     文件        5817  2016-12-12 16:32  WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
     文件        5308  2016-12-13 20:27  WindowsFormsApplication1\WindowsFormsApplication1\Form2.Designer.cs
     文件        1386  2016-12-14 21:49  WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs
     文件        5817  2016-12-13 20:27  WindowsFormsApplication1\WindowsFormsApplication1\Form2.resx
     文件        7837  2016-12-13 20:26  WindowsFormsApplication1\WindowsFormsApplication1\Form3.Designer.cs
     文件        2683  2016-12-14 22:23  WindowsFormsApplication1\WindowsFormsApplication1\Form3.cs
     文件        5817  2016-12-14 21:18  WindowsFormsApplication1\WindowsFormsApplication1\Form3.resx
     文件       10073  2016-12-13 20:50  WindowsFormsApplication1\WindowsFormsApplication1\Form4.Designer.cs
     文件        4729  2016-12-15 22:05  WindowsFormsApplication1\WindowsFormsApplication1\Form4.cs
     文件        5817  2016-12-13 22:26  WindowsFormsApplication1\WindowsFormsApplication1\Form4.resx
     文件        7112  2016-12-13 20:25  WindowsFormsApplication1\WindowsFormsApplication1\Form5.Designer.cs
     文件        2576  2016-12-14 21:49  WindowsFormsApplication1\WindowsFormsApplication1\Form5.cs
     文件        5817  2016-12-13 20:25  WindowsFormsApplication1\WindowsFormsApplication1\Form5.resx
     文件        6835  2016-12-15 20:37  WindowsFormsApplication1\WindowsFormsApplication1\Form6.Designer.cs
     文件        2627  2016-12-15 20:37  WindowsFormsApplication1\WindowsFormsApplication1\Form6.cs
     文件        5817  2016-12-15 20:37  WindowsFormsApplication1\WindowsFormsApplication1\Form6.resx
     文件         536  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Program.cs
     目录           0  2016-12-16 11:53  WindowsFormsApplication1\WindowsFormsApplication1\Properties\
     文件        1368  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs
     文件        2900  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs
     文件        5612  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx
     文件        1111  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.Designer.cs
     文件         249  2016-12-08 22:56  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.settings
     文件        5388  2016-12-13 20:37  WindowsFormsApplication1\WindowsFormsApplication1\WindowsFormsApplication1.csproj
............此处省略31个文件信息

评论

共有 条评论