資源簡介
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個文件信息
- 上一篇:OpenGL C# 旋轉Cube生成并渲染
- 下一篇:vs-IDL編程
評論
共有 條評論