資源簡介
本次開發主要做了從串口分別獲取讀者卡號和圖書卡號,實現圖書管理,圖書借閱,讀者管理等功能。開發語言是C#,開發環境使用Visual Studio 2015。數據庫采用sql Server

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.IO.Ports;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Data.SqlClient;
using?System.Windows.Forms;
using?System.Threading;
namespace?MyRFID
{
????public?partial?class?frmBorrowBook?:?Form
????{
????????baseClass.baseInfo?baseinfo?=?new?MyRFID.baseClass.baseInfo();//創建baseInfo類的對象
????????baseClass.baseInfo.cBorrowSituation?BorrowSituation?=?new?MyRFID.baseClass.baseInfo.cBorrowSituation();//創建cBorrowSituation類的對象
????????baseClass.baseInfo.cBook?Book?=?new?MyRFID.baseClass.baseInfo.cBook();//創建cBook類
????????public?delegate?void?Displaydelegate(byte[]?InputBuf);
????????Byte[]?OutputBuf?=?new?Byte[4];
????????public?Displaydelegate?disp_reader;
????????public?Displaydelegate?disp_book;
????????public?frmBorrowBook()
????????{
????????????InitializeComponent();
????????}
????????void?Comm_ReaderReceived(object?sender?SerialDataReceivedEventArgs?e)
????????{
????????????
????????????Byte[]?InputBuf?=?new?Byte[4];
????????????try
????????????{
????????????????if?(serialReader.IsOpen)
????????????????{
????????????????????serialReader.Read(InputBuf?0?serialReader.BytesToRead);????//讀取緩沖區的數據直到“}”即0x7D為結束符
?????????????????????????????????????????????????????????????????????????????????//InputBuf?=?UnicodeEncoding.Default.GetBytes(strRD);?//將得到的數據轉換成byte的格式
????????????????????System.Threading.Thread.Sleep(50);
????????????????????this.Invoke(disp_reader?InputBuf);
????????????????}
????????????}
????????????catch?(TimeoutException?ex)?????????//超時處理
????????????{
????????????????MessageBox.Show(ex.ToString());
????????????}
????????}
????????void?Comm_BookReceived(object?sender?SerialDataReceivedEventArgs?e)
????????{
????????????Byte[]?InputBuf?=?new?Byte[4];
????????????try
????????????{
????????????????if?(serialBook.IsOpen)
????????????????{
????????????????????serialBook.Read(InputBuf?0?serialBook.BytesToRead);????//讀取緩沖區的數據直到“}”即0x7D為結束符
?????????????????????????????????????????????????????????????????????????????//InputBuf?=?UnicodeEncoding.Default.GetBytes(strRD);?//將得到的數據轉換成byte的格式
????????????????????System.Threading.Thread.Sleep(50);
????????????????????this.Invoke(disp_book?InputBuf);
????????????????}
????????????}
????????????catch?(TimeoutException?ex)?????????//超時處理
????????????{
????????????????MessageBox.Show(ex.ToString());
????????????}
????????}
????????public?void?DispReader(byte[]?InputBuf)
????????{
????????????//textBox1.Text?=?Convert.ToString(InputBuf);
????????????string?result?=?string.Empty;
????????????string?readerno?=?string.Empty;
????????????string?selectReader?=?““;
????????????string?selectBorrow?=?““;
????????????baseOperate?bop?=?new?baseOperate();
????????????SqlDataReader?reader;
????????????DataSet?ds?=?new?DataSet();
????????????ASCIIEncoding?encodi
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.?????76288??2016-12-28?23:05??MyRFID\.vs\MyRFID\v14\.suo
?????文件????????189??2016-12-26?16:35??MyRFID\App.config
?????文件??????19229??2016-12-27?15:59??MyRFID\ba
?????文件???????2716??2016-12-28?10:12??MyRFID\ba
?????文件???????8031??2016-12-28?08:24??MyRFID\ba
?????文件?????303104??2016-12-28?22:40??MyRFID\bin\Debug\MyRFID.exe
?????文件????????189??2016-12-26?16:35??MyRFID\bin\Debug\MyRFID.exe.config
?????文件??????97792??2016-12-28?22:40??MyRFID\bin\Debug\MyRFID.pdb
?????文件??????22696??2016-12-28?22:41??MyRFID\bin\Debug\MyRFID.vshost.exe
?????文件????????189??2016-12-26?16:35??MyRFID\bin\Debug\MyRFID.vshost.exe.config
?????文件????????490??2010-03-17?22:39??MyRFID\bin\Debug\MyRFID.vshost.exe.manifest
?????文件???????8814??2016-12-28?22:40??MyRFID\frmBorrowBook.cs
?????文件???????8279??2016-12-28?22:40??MyRFID\frmBorrowBook.Designer.cs
?????文件??????29353??2016-12-28?22:40??MyRFID\frmBorrowBook.resx
?????文件???????5628??2016-12-28?22:20??MyRFID\frmInBook.cs
?????文件??????12036??2016-12-28?22:20??MyRFID\frmInBook.Designer.cs
?????文件?????107788??2016-12-28?22:20??MyRFID\frmInBook.resx
?????文件???????5367??2016-12-28?22:20??MyRFID\frmInStudent.cs
?????文件???????9818??2016-12-28?22:20??MyRFID\frmInStudent.Designer.cs
?????文件?????107788??2016-12-28?22:20??MyRFID\frmInStudent.resx
?????文件??????12070??2016-12-27?17:32??MyRFID\frmMain.cs
?????文件??????19835??2016-12-27?17:32??MyRFID\frmMain.Designer.cs
?????文件???????6412??2016-12-27?17:32??MyRFID\frmMain.resx
?????文件???????1065??2016-12-28?22:22??MyRFID\frmOperate.cs
?????文件???????3625??2016-12-28?22:22??MyRFID\frmOperate.Designer.cs
?????文件?????146223??2016-12-28?22:22??MyRFID\frmOperate.resx
?????文件??????67646??2016-12-28?22:04??MyRFID\ico\administrator_128px_28419_easyicon.net.ico
?????文件???????9636??2016-12-28?22:04??MyRFID\ico\administrator_128px_28419_easyicon.net.png
?????文件??????67646??2016-12-28?22:02??MyRFID\ico\books_read_school_study_128px_1422_easyicon.net.ico
?????文件??????14780??2016-12-28?22:02??MyRFID\ico\books_read_school_study_128px_1422_easyicon.net.png
............此處省略64個文件信息
- 上一篇:C#實現的GPS實時跟蹤系統
- 下一篇:中文地名分詞+地名詞典創建工具
評論
共有 條評論