|
簡單的C# RFID標(biāo)簽系統(tǒng)PPT內(nèi)容:
0.jpg (42 KB, 下載次數(shù): 63)
下載附件
2018-9-26 17:25 上傳
0.png (43.04 KB, 下載次數(shù): 80)
下載附件
2018-9-26 17:26 上傳
首先要將需要定位監(jiān)控的物資上面安裝一張半有源RFID的低頻激活電子標(biāo)簽該標(biāo)簽具有唯一的編碼,并給具有合法拿取物品的管理人員登記和發(fā)放一個(gè)電子標(biāo)簽卡,用于標(biāo)識(shí)管理人員的身份,然后將物資放置在雙頻報(bào)警主機(jī)有效監(jiān)控范圍內(nèi)的指定位置上,并建立起物資與存放位置之間的對應(yīng)關(guān)系。系統(tǒng)工作時(shí),雙頻報(bào)警主機(jī)內(nèi)的低頻觸發(fā)激活器連續(xù)不斷發(fā)射低頻激活信號(hào),激活貴重物品上的電子標(biāo)簽,電子標(biāo)簽把信號(hào)再發(fā)射出去,有效識(shí)別范圍內(nèi)的讀寫器將收到該標(biāo)簽同頻段發(fā)射的數(shù)據(jù)包,解析出該數(shù)據(jù)包中的標(biāo)簽ID號(hào)和激活器編號(hào)以及RSSI值后立刻上傳到上位機(jī)電腦。當(dāng)貴重物品上的標(biāo)簽被移出2m外,激活器發(fā)射的信號(hào)不能激活標(biāo)簽,相對應(yīng)讀寫器也讀取不了標(biāo)簽信息,聲光報(bào)警裝置進(jìn)行報(bào)警。同時(shí),在倉庫不同的地方,安裝一些有源RFID遠(yuǎn)距離讀寫器,用于采集低頻激活電子標(biāo)簽被激活后發(fā)出的信息(包括電子標(biāo)簽本身的ID號(hào),低頻激活天線的地址碼),讀寫器采集到數(shù)據(jù)后,通過各種傳輸方式,將信息上傳給電腦管理中心。以便及時(shí)發(fā)現(xiàn)異常和采取措施。
0.png (28.25 KB, 下載次數(shù): 69)
下載附件
2018-9-26 17:26 上傳
遇到的問題和需要討論的問題
在解決報(bào)警問題上,不知道怎樣處理。當(dāng)激活器發(fā)射的信號(hào)不能激活標(biāo)簽,相對應(yīng)讀寫器也讀取不了標(biāo)簽信息,聲光報(bào)警裝置進(jìn)行報(bào)警。所以就設(shè)定當(dāng)取值為空時(shí)報(bào)警器報(bào)警。
由于條件限制,讀卡距離較近,還不能很好的起到實(shí)時(shí)防盜的作用。但實(shí)驗(yàn)表明,此設(shè)計(jì)的電路運(yùn)行穩(wěn)定,讀寫數(shù)據(jù)準(zhǔn)確,操作時(shí)間較短,在理論上是完全可以實(shí)現(xiàn)的。
0.png (33.95 KB, 下載次數(shù): 60)
下載附件
2018-9-26 17:27 上傳
1、管理人員可以根據(jù)用戶名和密碼登錄超市防盜系統(tǒng)
2、讀寫器采集到數(shù)據(jù)后,將信息上傳給電腦管理中心。管理人員可以知道這箱貨物的名字、生產(chǎn)地、生廠商編號(hào)、數(shù)量和生產(chǎn)日期等基本信息,并寫入數(shù)據(jù)庫中。
3、當(dāng)激活器發(fā)射的信號(hào)不能激活標(biāo)簽,不能正常顯示出信息。相對應(yīng)讀寫器也讀取不了標(biāo)簽信息,聲光報(bào)警裝置進(jìn)行報(bào)警。
0.png (23.32 KB, 下載次數(shù): 68)
下載附件
2018-9-26 17:28 上傳
c#源程序如下:
- 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 RFID
- {
- public partial class DataConveyForm : Form
- {
-
- public DataConveyForm()
- {
- InitializeComponent();
- }
- /*****************屏蔽窗體右上角關(guān)閉按鈕******************/
- private const int CP_NOCLOSE_BUTTON = 0x200;
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams myCp = base.CreateParams;
- myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
- return myCp;
- }
- }
- /*************************************************************/
- /******************退出數(shù)據(jù)傳送窗口,返回到監(jiān)控窗口****************************/
- private void button3_Click(object sender, EventArgs e)
- {
- serialPort1.Close();
- MonitoringForm monitoringform = new MonitoringForm();
- this.Close();
- monitoringform.Show();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- switch(comboBox2.SelectedIndex )
- {
- case 0:
- comboBox2.Items.Clear();
- comboBox2.Items.Add("甘肅");
- comboBox2.Items.Add("遼寧");
- comboBox2.Items.Add("陜西");
- comboBox2.Items.Add("湖南");
- comboBox2.Items.Add("北京");
- break;
- }
- }
- /***********************************************************************************************/
- /******************************將學(xué)生信息插入到數(shù)據(jù)庫中***************************************************/
-
-
-
- /*private void button1_Click(object sender, EventArgs e)
- {
- if (textBox1.Text.Length == 0 | comboBox2.Text.Length == 0 | textBox3.Text.Length == 0 | textBox4.Text.Length == 0 | textBox5.Text.Length == 0 | textBox6.Text.Length == 0|comboBox2.Text.Length ==0|comboBox2.Text.Length ==0)
- {
- MessageBox.Show("學(xué)生信息輸入不完整,請檢查準(zhǔn)確輸入");
- return;
- }
- string sqlCheck = "SELECT count ( * ) FROM [StudentMsg] WHERE StudentId='" +textBox5.Text.ToString().Trim() + "'";
- SqlConnection conn = new SqlConnection(connstring);
- SqlCommand cmdCheck = new SqlCommand(sqlCheck, conn);
- int checkCount = 0;
- try
- {
- conn.Open();
- checkCount = (int)cmdCheck.ExecuteScalar();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- if (checkCount > 0)
- {
- conn.Close();
- MessageBox.Show("此學(xué)號(hào)在后臺(tái)數(shù)據(jù)庫中已經(jīng)存在,學(xué)號(hào)不能重復(fù),請重新輸入,注意只能輸入數(shù)字");
- return;
- }
- string dept = comboBox2.SelectedItem.ToString(); //學(xué)院
- string spec = comboBox2.SelectedItem.ToString(); //專業(yè)
- string sql = String.Format("INSERT INTO StudentMsg(Department,StudentId,Name,Sex,Grade,DormitoryId,Speciality,ObjectId,HostId)VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", dept, textBox5.Text, textBox1.Text, sex, comboBox2.Text, textBox6.Text, spec, textBox3.Text, textBox4.Text);
- using (SqlConnection conn1 = new SqlConnection(connstring))
- {
- conn.Close();
- conn1.Open();
- SqlCommand comm = new SqlCommand(sql, conn1);
- int n = comm.ExecuteNonQuery();
- if (n > 0)
- {
- MessageBox.Show("添加學(xué)生信息成功!", "添加成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
- conn1.Close();
- this.textBox1.Text = "";
- this.comboBox2.Text = "";
- this.textBox3.Text = "";
- this.textBox4.Text = "";
- this.textBox6.Text = "";
- }
- else
- {
- MessageBox.Show("添加學(xué)生信息失敗!", "添加失敗", MessageBoxButtons.OK, MessageBoxIcon.Information);
- conn1.Close();
- }
- }
- }/*
- /********************************************************************************************************/
- /*********************************************當(dāng)前顯示*************************************/
- private void DataConveyForm_Load(object sender, EventArgs e)
- {
- try
- {
- comboBox2.SelectedIndex = 0;
- comboBox2.SelectedIndex = 0;
- serialPort1.Open();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "串口設(shè)置操作出錯(cuò)!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- }
- /************************************************************************************************/
- /**********************************獲取物品標(biāo)簽號(hào)***********************************************/
- private void button4_Click(object sender, EventArgs e)
- {
- string temp;
- string data;
- string data1;
- try
- {
- serialPort1.WriteLine("010900210200040000");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "串口設(shè)置操作出錯(cuò)!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- temp = serialPort1.ReadLine();
- System.Threading.Thread.Sleep(1000);
- try
- {
- serialPort1.WriteLine("010900210200040000");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "串口設(shè)置操作出錯(cuò)!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- data = serialPort1.ReadLine();
- if (data [0]=='[')
- {
- data1 = data.Substring(4, 4) + data.Substring(9, 4) + data.Substring(14, 4) + data.Substring(19, 4);
- textBox3.Text = data1;
- }
- else
- {
- MessageBox.Show("獲取物品標(biāo)簽號(hào)失敗,請注意檢查!", "獲取物品標(biāo)簽失敗", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- }
- /***************************************************************************************/
- /*********************************獲取主人標(biāo)簽號(hào)*********************************************/
- private void button5_Click(object sender, EventArgs e)
- {
- string temp;
- string data;
- string data1;
- try
- {
- serialPort1.WriteLine("010900210200040000");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "串口設(shè)置操作出錯(cuò)!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- temp = serialPort1.ReadLine();
- System.Threading.Thread.Sleep(1000);
- try
- {
- serialPort1.WriteLine("010900210200040000");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "串口設(shè)置操作出錯(cuò)!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- data = serialPort1.ReadLine();
- if (data[0] == '[')
- {
- data1 = data.Substring(4, 4) + data.Substring(9, 4) + data.Substring(14, 4) + data.Substring(19, 4);
- textBox4.Text = data1;
- }
- else
- {
- MessageBox.Show("獲取主人標(biāo)簽號(hào)失敗,請注意檢查!", "獲取主人標(biāo)簽失敗", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- }
- private DataSet dsUser;
- private void button1_Click(object sender, EventArgs e)
- {
- string connstring = @"Data Source=210.26.96.51;Initial Catalog=BC;User ID=sa;Pwd=95069506";
- if (dsUser == null)
- {
- MessageBox.Show("當(dāng)前頁面數(shù)據(jù)表空,請先刷新顯示全部數(shù)據(jù),然后進(jìn)行操作。");
- return;
- }
- if (textBox1.Text.Length == 0)
- {
- MessageBox.Show("商品名稱不能為空,請輸入準(zhǔn)確的廠商名稱!");
- return;
- }
- if (comboBox2.Text.Length == 0)
- {
- MessageBox.Show("生產(chǎn)地不能為空,請輸入準(zhǔn)確的運(yùn)輸商名稱!");
- return;
- }
- if (textBox6.Text.Length == 0)
- {
- MessageBox.Show("系統(tǒng)銷售商名稱不能為空,請輸入準(zhǔn)確的銷售商名稱!");
- return;
- }
- if (numericUpDown1.Text.Length == 0)
- {
- MessageBox.Show("訂單日期名稱不能為空,請輸入準(zhǔn)確的銷售商名稱!");
- return;
- }
- if (dateTimePicker1.Text.Length == 0)
- {
- MessageBox.Show("訂單數(shù)量不能為空,請輸入準(zhǔn)確的銷售商名稱!");
- return;
- }
- string sqlCheck = "SELECT count ( * ) FROM [Store] WHERE ProName='" + textBox1.Text.ToString().Trim() + "'";
- SqlConnection conn = new SqlConnection(connstring);
- SqlCommand cmdCheck = new SqlCommand(sqlCheck, conn);
- int checkCount = 0;
- try
- {
- conn.Open();
- checkCount = (int)cmdCheck.ExecuteScalar();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- sqlCheck = "INSERT INTO [Store] VALUES ('" + textBox1.Text.ToString().Trim() + "','" + comboBox2.Text.ToString().Trim() + "','" + textBox6.Text.ToString().Trim() + "','" + numericUpDown1.Text.ToString().Trim() + "','" + dateTimePicker1.Text.ToString().Trim() + "')";
- try
- {
- cmdCheck = new SqlCommand(sqlCheck, conn);
- cmdCheck.ExecuteNonQuery();
- }
- catch (Exception ex)
- {
- conn.Close();
- MessageBox.Show(ex.Message);
- return;
- }
- sqlCheck = "SELECT '商品名'=ProName,'生產(chǎn)地'=Production,'生產(chǎn)商編號(hào)'=ProId,'購買數(shù)量'=Number,'生產(chǎn)日期'=DataName FROM [Store]";
- try
- {
- SqlDataAdapter da = new SqlDataAdapter();
- da.SelectCommand = new SqlCommand(sqlCheck, conn);
- dsUser = new DataSet("Store");
- da.Fill(dsUser, "Store");
- this.dataGridViewIndex.DataSource = dsUser.Tables["Store"];
- this.dataGridViewIndex.Refresh();
- this.dataGridViewIndex.Show();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- finally
- {
- conn.Close();
- }
- this.textBox1.Text = "";
- this.comboBox2.Text = "";
- this.textBox6.Text = "";
- this.numericUpDown1.Text = "";
- this.dateTimePicker1.Text = "";
- MessageBox.Show("數(shù)據(jù)新增完畢!");
- }
- private int selectRows = -1;
- private string tmpProName = "";
- private string tmpProduction = "";
- private string tmpProId = "";
- private string tmpNumber = "";
- private string tmpDataName = "";
- private void dataGridViewIndex_CellContentClick(object sender, DataGridViewCellEventArgs e)
- {
- this.selectRows = dataGridViewIndex.CurrentRow.Index;
- this.textBox1.Text = dsUser.Tables["Store"].Rows[selectRows][0].ToString();
- this.comboBox2.Text = dsUser.Tables["Store"].Rows[selectRows][1].ToString();
- this.textBox6.Text = dsUser.Tables["Store"].Rows[selectRows][2].ToString();
- this.numericUpDown1.Text = dsUser.Tables["Store"].Rows[selectRows][3].ToString();
- this.dateTimePicker1.Text= dsUser.Tables["Store"].Rows[selectRows][4].ToString();
- this.tmpProName = dsUser.Tables["Store"].Rows[selectRows][0].ToString();
- this.tmpProduction = dsUser.Tables["Store"].Rows[selectRows][1].ToString();
- this.tmpProId = dsUser.Tables["Store"].Rows[selectRows][2].ToString();
- this.tmpNumber = dsUser.Tables["Store"].Rows[selectRows][3].ToString();
- this.tmpDataName = dsUser.Tables["Store"].Rows[selectRows][4].ToString();
-
- }
- /**********************************************顯示*************************************************************/
- ……………………
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復(fù)制代碼
0.png (43.77 KB, 下載次數(shù): 75)
下載附件
2018-9-26 17:29 上傳
0.png (12.39 KB, 下載次數(shù): 70)
下載附件
2018-9-26 17:29 上傳
所有資料51hei提供下載:
便利超市的防盜系統(tǒng).rar
(9.95 MB, 下載次數(shù): 107)
2018-9-26 15:12 上傳
點(diǎn)擊文件名下載附件
用C# 做的 下載積分: 黑幣 -5
|
評(píng)分
-
查看全部評(píng)分
|