• 大小: 336KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-10-04
  • 语言: C#
  • 标签: C#  SQL  Server  

资源简介

基于VS2010+C#+SQL Server 开发的图书管理系统 用户账户:lp 密码:lp 管理员:admin 密码:admin 附数据库 sql server 2008 此资源仅供学习!

资源截图

代码片段和文件信息

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

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public static class Pub
        {
            public static int id = 0;
            public static string Server = “DESKTOP-R11QIRD\\LPIECES“;
            public static string Database = “D:\\VS\\期末作品\\WINDOWSFORMSAPPLICATION1\\WINDOWSFORMSAPPLICATION1\\DATAbase1.MDF“;
            public static string Uid = “sa“;
            public static string Pwd = “18344103923“;
        }
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            int count = 0;
            if (count > 3)
            {
                MessageBox.Show(“你输入的次数超过3次程序马上关闭!“);
                Application.Exit();
            }
            else if ( yhm.Text.Trim() == ““ || mm.Text.Trim() == ““)
            {
                MessageBox.Show(“用户名或密码不能为空!“);
                yhm.Focus();
                return;
            }
            else {
                if (this.radioButton2.Checked == true)
                {
                    SqlConnection conn = new SqlConnection(“server=“ + Form1.Pub.Server + “;database=“ + Form1.Pub.Database + “;uid=“ + Form1.Pub.Uid + “;pwd=“ + Form1.Pub.Pwd);
                    string strsql = “select * from yh where yhxm=‘“ + yhm.Text + “‘ and yhmm=‘“ + mm.Text + “‘“;
                    string select = “select yhid from yh where yhxm=‘“ + yhm.Text + “‘“;
                    conn.Open();
                    SqlCommand com = new SqlCommand(strsql conn);
                    if (com.ExecuteScalar() == null)
                    {
                        MessageBox.Show(“登录失败!用户名或密码错误!“);
                    }
                    else
                    {
                        SqlCommand comm = new SqlCommand(select conn);
                        string Id = comm.ExecuteScalar().ToString();
                        MessageBox.Show(“登录成功!“);
                        Form1.Pub.id = Convert.ToInt32(Id);
                        comm.Clone();
                        this.Hide();
                        Form2 f1 = new Form2();
                        f1.Show();
                    }
                    com.Clone();
                    conn.Close();
                }
                else if (this.radioButton1.Checked == true)
                {
                    SqlConnection conn = new SqlConnection(“server=“ + Form1.Pub.Server + “;database=“ + Form1.Pub.Database + “;uid=“ + Form1.Pub.Uid + “;pwd=“ + Form1.Pub.Pwd);
                    string strsql = “select * from gly where glyxm=‘“ + yhm.Text + “‘ and glymm=‘“ + mm.Text + “‘“;
                    string select = “select glyid from gly whe

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-16 14:37  图书管理系统\
     文件     2359296  2019-01-10 17:37  图书管理系统\Database1.mdf
     文件      851968  2019-01-10 17:37  图书管理系统\Database1_log.LDF
     目录           0  2019-03-16 14:37  图书管理系统\WindowsFormsApplication1\
     目录           0  2019-03-16 14:37  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\
     文件         878  2018-12-31 14:14  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1.sln
     文件       48640  2019-01-10 22:16  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1.suo
     目录           0  2019-03-16 14:37  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\
     目录           0  2019-03-16 14:37  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
     文件       57344  2019-01-10 22:16  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
     文件      153088  2019-01-10 22:16  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
     文件       11600  2019-01-10 22:16  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
     文件         490  2018-09-15 15:29  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
     目录           0  2018-12-31 14:14  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\
     文件        4252  2019-01-10 00:39  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
     文件        6146  2019-01-10 00:39  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
     文件        5817  2019-01-10 00:39  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
     文件        1754  2019-01-10 00:21  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs
     文件        5783  2019-01-10 00:21  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form2.Designer.cs
     文件        6015  2019-01-10 00:21  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form2.resx
     文件        1772  2019-01-10 17:07  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form3.cs
     文件        6051  2019-01-10 17:07  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form3.Designer.cs
     文件        6015  2019-01-10 17:07  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form3.resx
     文件        1806  2019-01-09 21:12  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form4.cs
     文件        3989  2019-01-09 21:12  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form4.Designer.cs
     文件        5817  2019-01-09 21:12  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form4.resx
     文件        2712  2019-01-09 15:04  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form5.cs
     文件        5679  2019-01-09 14:45  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form5.Designer.cs
     文件        5817  2019-01-09 14:45  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form5.resx
     文件        8565  2019-01-10 22:16  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form6.cs
     文件       12334  2019-01-10 00:01  图书管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Form6.Designer.cs
............此处省略48个文件信息

评论

共有 条评论