• 大小: 1.76MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-26
  • 语言: C#
  • 标签: C#  Winform  源代码  

资源简介

C#Winform实现网吧管理系统源代码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace ckoform
{
    public partial class DengLuFrom : Form
    {
        //声明线程
        Thread mythread;
        //声明套接字
        Socket socket;
        public DengLuFrom()
        {
            InitializeComponent();
           
        }
        public void BeginSend(string mes)
        {
            try
            {
                IPAddress serverIp = IPAddress.Parse(“127.0.0.1“);
                IPEndPoint iep = new IPEndPoint(serverIp 8000);
                byte[] bMessage;
                Socket socket = new Socket(AddressFamily.InterNetwork SocketType.Stream ProtocolType.Tcp);
                socket.Connect(iep);
                bMessage = Encoding.Unicode.GetBytes(mes);
                socket.Send(bMessage);
                socket.Shutdown(SocketShutdown.Both);
                socket.Close();
            }
            catch (SocketException se)
            {
                MessageBox.Show(se.Message “警告“);
            }
        }
        string logID;
        string USTATE;
        string commputernum;
        private void btnQueding_Click(object sender EventArgs e)
        {
          
            if (this.txtName.Text == ““)
            {
                MessageBox.Show(“请在文本框中输入内容“);
                this.txtName.Focus();
                return;
            }
            SqlConnection conn = new SqlConnection(“server=.;uid=sa;pwd=123456;database=internetBar“);
            SqlDataReader sdr;
            try
            {
                conn.Open();
                string str = “SELECT * FROM UserInformation WHERE [ID Card]  = ‘“ + this.txtName.Text.Trim() + “‘ AND Password = ‘“ + this.txtPassword.Text.Trim() + “‘“;
                SqlCommand cmd = new SqlCommand(str conn);
                sdr = cmd.ExecuteReader();
                if (sdr.Read())
                {
                    if (sdr[“UserType“].ToString() == “2“)
                    {
                        this.Visible = false;
                        xinxi = new xinxiform(this.txtName.Text.Trim() this.txtPassword.Text.Trim() this);
                        xinxi.Show();
                        //USTATE = 3;
                    }
                    else if (sdr[“UserState“].ToString() == “已注册“)
                    {
                        this.Visible = false;
                        xinxi = new xinxiform(this.txtName.Text.Trim() this.txtPassword.Text.Trim() this);
                        xinxi.Show();
                        logID = sdr[“id“].ToString();
                        commputernum = “014“;
                        USTATE = “1“;
                        BeginSend(“0100000“ + logID + commputernum 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-21 10:35  ckoform\
     目录           0  2013-01-20 14:18  ckoform\bin\
     目录           0  2013-01-22 18:11  ckoform\bin\Debug\
     文件       94208  2013-02-03 17:16  ckoform\bin\Debug\ckoform.exe
     文件       77312  2013-02-03 17:16  ckoform\bin\Debug\ckoform.pdb
     文件       11600  2013-02-03 17:18  ckoform\bin\Debug\ckoform.vshost.exe
     文件         490  2010-03-17 22:39  ckoform\bin\Debug\ckoform.vshost.exe.manifest
     目录           0  2013-01-20 14:18  ckoform\bin\Release\
     文件        5829  2013-01-21 10:35  ckoform\ckoform.csproj
     文件         855  2013-01-16 09:45  ckoform\ckoform.sln
     文件       31232  2013-02-03 17:19  ckoform\ckoform.suo
     文件        8987  2013-01-22 16:12  ckoform\DengLuFrom.cs
     文件       19568  2013-01-21 09:20  ckoform\DengLuFrom.designer.cs
     文件        5817  2013-01-21 09:20  ckoform\DengLuFrom.resx
     文件        1915  2013-01-21 15:53  ckoform\dingcan.cs
     文件        4313  2013-01-17 14:08  ckoform\dingcan.Designer.cs
     文件       25588  2013-01-17 14:08  ckoform\dingcan.resx
     文件         357  2013-01-21 10:35  ckoform\Form1.cs
     文件        1167  2013-01-21 10:35  ckoform\Form1.Designer.cs
     文件        5507  2013-01-20 17:46  ckoform\hujiaoforms.cs
     文件        5667  2013-01-20 14:02  ckoform\hujiaoforms.Designer.cs
     文件       25588  2013-01-20 14:02  ckoform\hujiaoforms.resx
     文件        7939  2013-01-22 22:31  ckoform\Mainfrom.cs
     文件       13348  2013-01-22 18:51  ckoform\Mainfrom.Designer.cs
     文件       48800  2013-01-22 18:51  ckoform\Mainfrom.resx
     目录           0  2013-01-17 15:26  ckoform\obj\
     目录           0  2013-01-17 15:26  ckoform\obj\x86\
     目录           0  2013-02-03 17:16  ckoform\obj\x86\Debug\
     文件        2832  2013-02-03 17:18  ckoform\obj\x86\Debug\ckoform.csproj.FileListAbsolute.txt
     文件         180  2013-01-22 18:11  ckoform\obj\x86\Debug\ckoform.DengLuFrom.resources
     文件       13428  2013-02-03 17:16  ckoform\obj\x86\Debug\ckoform.dingcan.resources
............此处省略93个文件信息

评论

共有 条评论