亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfid.cs

?? 手持式RFID及條碼車輛識別系統手持機代碼
?? CS
字號:
using System;
using System.Data;
using System.Text;
using System.Windows.Forms;

//
using Intermec.DataCollection.RFID;


namespace RFID_CAR
{
    /// <summary>
    /// RFID 的摘要說明。
    /// </summary>
    public class RFIDtags
    {
        public BRIReader m_Reader = null;
        public bool m_fConnected = false;
        private Control m_Owner = null;
        public string sCurrentTagType = "";


        public RFIDtags(Control owner)
        {
            m_Owner = owner;


            //
            // TODO: 在此處添加構造函數邏輯
            //
        }
        public void Dispose()
        {
            if (this.m_Reader != null)
            {
                this.m_Reader.Dispose();
                this.m_Reader = null;
            }

        }
        bool IsDceTransport(string aReaderURI)
        {
            return (aReaderURI == null || aReaderURI.IndexOf("127.0.0.1") != -1) ?
                true : false;
        }
        public bool OpenRFIDReader(System.String sURIAddress)
        {
            bool fSuccess = true;
            //
            // Enable the DCE transport on the host computer (series 700 device).
            //
            if (IsDceTransport(sURIAddress) && this.EnableDCETransport() == false)
                return false;

            try
            {	// v2.4: Enable logging to a file using the AdvancedBRI class library.
                //
                BRIReader.LoggerOptionsAdv logOpts = new BRIReader.LoggerOptionsAdv();
                logOpts.LogEnable = true;
                logOpts.LogFilePath = @"\MySampleLog1.txt";
                logOpts.TimeStampEnable = true;
                logOpts.ShowNonPrintableChars = true;
                logOpts.MaxFileSize = 200000;
                //
                // Open a connection to an IP4 reader using the AdvancedBRI class library.
                //
                this.m_Reader = new BRIReader(m_Owner, sURIAddress, logOpts);
                if (this.m_Reader.IsConnected)
                {
                }
            }
            catch (BasicReaderException e)
            {
                fSuccess = false;
                string sErr = e.Message.ToString();
                if (null != this.m_Reader)
                {
                    this.m_Reader.Dispose();
                    this.m_Reader = null;
                }
            }
            catch (System.SystemException e)
            {
                fSuccess = false;
                string sErr = e.Message.ToString();
                if (null != this.m_Reader)
                {
                    this.m_Reader.Dispose();
                    this.m_Reader = null;
                }
            }
            catch (Exception e)
            {
                fSuccess = false;
                string sErr = e.Message.ToString();
                if (null != this.m_Reader)
                {
                    this.m_Reader.Dispose();
                    this.m_Reader = null;
                }
            }
            this.m_fConnected =
                (null != this.m_Reader && this.m_Reader.IsConnected) ? fSuccess : false;
            return this.m_fConnected;
        }
        private bool EnableDCETransport()
        {
            bool fSuccess = false;
            try
            {
                BRIReader DCEConfig = new BRIReader(null, "TCP://127.0.0.1:2188");
                string sr = DCEConfig.Execute("device 1 attrib adminstatus");
                if (sr.IndexOf("ADMINSTATUS=ON", 0) == -1)
                {	//
                    // The DCE's IP4 reader connection is not configured, so enable it now.
                    //
                    sr = DCEConfig.Execute("device 1 attrib adminstatus=on");
                }
                if (sr.IndexOf("ERR") == -1)
                    fSuccess = true;
                else
                    fSuccess = false;

                DCEConfig.Dispose();
            }
            catch (BasicReaderException bex)
            {
                fSuccess = false;
            }
            catch (Exception ex)
            {
                fSuccess = false;
            }
            return fSuccess;
        }
        public bool SetReaderTagType(string sType)
        {
            bool fResult = false;

            if (this.m_Reader.IsConnected)
            {
                int iType = -1;
                switch (sType.ToUpper())
                {
                    case "ISO":
                        iType = ReaderAttributes.TagTypeMask.ISO6B_G2;
                        sCurrentTagType = "ISO";
                        break;
                    case "GEN2":
                        iType = ReaderAttributes.TagTypeMask.EPC_CLASS1_G2;
                        sCurrentTagType = "GEN2";
                        break;
                    case "UCODE119":
                        iType = ReaderAttributes.TagTypeMask.ICODE119;
                        sCurrentTagType = "UCODE119";
                        break;
                    default:
                        sCurrentTagType = "ISO";
                        iType = ReaderAttributes.TagTypeMask.MIXED;
                        break;
                }
                if (-1 != iType)
                    fResult = this.m_Reader.Attributes.SetTagTypes(iType);
            }

            return fResult;
        }
        public bool SearchTags()
        {
            string sSchema = null, sFilter = null;
            bool fSuccess = false;

            if (this.m_Reader == null)
            {
                return false;
            }
            // Do not permit writes with data-fields when the reader is 
            // configured for gen2 tags or code 119 tags.
            //
            if (this.sCurrentTagType == "GEN2" || this.sCurrentTagType == "UCODE119")
            {
                // EPC-Gen2 tags do no support data fields, though some accept 4 bytes 
                // in bank2.
                //
                sSchema = null; sFilter = null;
            }
            else
            {
                // Create a BRI schema used to read two 4-byte strings from an 
                // ISO tag starting respectively at offsets 18 and 22.
                //
                sSchema = "";
                sFilter = "TAGID=H????????????????";
            }
            try
            {
                if (null == sSchema)
                {
                    // No data fields exist for this tag type, just get each 
                    // tag's tag-key value.
                    //
                    this.m_Reader.DefaultFieldSchema = null;
                    fSuccess = m_Reader.Read();
                }
                else
                {	// Use data fields and a filter for this tag type.
                    // The first argument is a TagKey filter, and the second 
                    // argument is the schema string that defines the fields 
                    // we want to read from the tag. Upon success, the 
                    // BRIReader.Tags[] array will contain one Tag object for 
                    // each tag that was read, and each Tag object will contain 
                    // TagField elements containing data read from the physical 
                    // tag.
                    //
                    fSuccess = m_Reader.Read(sFilter, sSchema);
                }
                if (m_Reader.TagCount == 0)
                {
                    return false;
                }
                if (this.m_Reader.IsTagError)
                {
                    return false;
                }
            }
            catch (Intermec.DataCollection.RFID.BasicReaderException e)
            {
                fSuccess = false;
            }
            catch (Intermec.DataCollection.RFID.BRIParserException e)
            {
                fSuccess = false;
            }
            catch (SystemException e)
            {
                fSuccess = false;
            }
            if (m_Reader.TagCount > 1) fSuccess = false;
            return fSuccess;
        }

        public String DisplayTagsAsStrings()
        {
            String rst = "";

            

            foreach (Tag tt in m_Reader.Tags)
            {	//
                // Populate each Tag node in the TreeView with its unique tag key.
                //

                rst += tt.ToString();
            }
            return (rst);
        }
        public String GetTagsFiledAsString()
        {
            Tag tt = (Tag)(m_Reader.Tags.GetValue(0));
            string sField = "";

            if (tt.TagFields.ItemCount > 0)
            {
                foreach (TagField tf in tt.TagFields.FieldArray)
                {
                    // Populate the Tag node in the treeview with each of its fields.
                    //
                    sField = tf.ToString();	// TagField data as a string.
                }
            }
            return sField;
        }

        public bool ReadTags(String TagID, int start, int len)
        {
            string sSchema = null, sFilter = null;
            bool fSuccess = false;

            if (this.m_Reader == null)
            {
                return false;
            }
            // Do not permit writes with data-fields when the reader is 
            // configured for gen2 tags or code 119 tags.
            //
            if (this.sCurrentTagType == "GEN2" || this.sCurrentTagType == "UCODE119")
            {
                // EPC-Gen2 tags do no support data fields, though some accept 4 bytes 
                // in bank2.
                //
                sSchema = null; sFilter = null;
            }
            else
            {
                // Create a BRI schema used to read two 4-byte strings from an 
                // ISO tag starting respectively at offsets 18 and 22.
                //
                sSchema = "string(" + start + "," + len + ")";
                sFilter = "TAGID=H" + TagID;
            }
            try
            {
                if (null == sSchema)
                {
                    // No data fields exist for this tag type, just get each 
                    // tag's tag-key value.
                    //
                    this.m_Reader.DefaultFieldSchema = null;
                    fSuccess = m_Reader.Read();
                }
                else
                {	// Use data fields and a filter for this tag type.
                    // The first argument is a TagKey filter, and the second 
                    // argument is the schema string that defines the fields 
                    // we want to read from the tag. Upon success, the 
                    // BRIReader.Tags[] array will contain one Tag object for 
                    // each tag that was read, and each Tag object will contain 
                    // TagField elements containing data read from the physical 
                    // tag.
                    //
                    fSuccess = m_Reader.Read(sFilter, sSchema);
                }
                if (m_Reader.TagCount == 0)
                {
                    return false;
                }
                if (this.m_Reader.IsTagError)
                {
                    return false;
                }
            }
            catch (Intermec.DataCollection.RFID.BasicReaderException e)
            {
                fSuccess = false;
            }
            catch (Intermec.DataCollection.RFID.BRIParserException e)
            {
                fSuccess = false;
            }
            catch (SystemException e)
            {
                fSuccess = false;
            }
            return fSuccess;
        }

        public bool WriteTags(String TagID, int start, int len, String data)
        {
            string sSchema = null, sFilter = null;
            bool fSuccess = false;
            string writecmd = null;
            //TagField tf = new TagField();
            writecmd = "write string(" + start.ToString() + "," + len.ToString() + ")=\"" + data + "\"";

            byte [] retBuffer = new byte [2048];
			
            try
            {
                m_Reader.Execute(System.Text.ASCIIEncoding.ASCII.GetBytes(writecmd), retBuffer);
                
                string xxx = System.Text.ASCIIEncoding.ASCII.GetString(retBuffer, 0, 2048);
                string[] x = xxx.Split(' ');
                if (x[1].StartsWith("WROK"))
                    if (ReadTags(TagID, start, len))
                        if (string.Equals(GetTagsFiledAsString(), data))
                            return true;

                //Tag tt = (Tag)(m_Reader.Tags.GetValue(0));
				
                //if(tt.TagFields.ItemCount >= 0 )
                //{
                //    tt.TagFields.GetField(0).SetDataString (data,0x20,data.Length);
                //    fSuccess = m_Reader.Update();
                //}

                if( this.m_Reader.IsTagError )
                {
                    return false;
                }
            }
            catch( Intermec.DataCollection.RFID.BasicReaderException e )
            {
                return false;
            }
            catch( Intermec.DataCollection.RFID.BRIParserException e )
            {
				
                return false;
            }
            catch( SystemException e )
            {
                return false;
            }
             

            return false;
            
        }
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品第1页| 中文字幕五月欧美| 欧美日韩高清一区二区| 色香蕉久久蜜桃| 91免费视频观看| 在线观看区一区二| 欧美麻豆精品久久久久久| 欧美图片一区二区三区| 欧美日韩在线播放一区| 91精品久久久久久久久99蜜臂| 欧美日韩一区二区不卡| 日韩欧美中文一区二区| 久久久久久久精| 中文字幕亚洲在| 午夜视频一区二区| 韩国女主播一区二区三区| 国产盗摄一区二区| 色综合网站在线| 91麻豆精品国产无毒不卡在线观看| 日韩亚洲欧美高清| 国产精品欧美一区二区三区| 亚洲精品成人精品456| 亚洲成人tv网| 国产电影一区在线| 欧美色图免费看| 久久蜜臀中文字幕| 夜夜操天天操亚洲| 精品一区二区av| 91黄视频在线| 精品福利av导航| 亚洲精品免费在线播放| 久久精品久久精品| 91最新地址在线播放| 91精品国产一区二区| 中文一区二区在线观看| 亚洲国产精品久久不卡毛片 | 久久国产精品免费| 粉嫩av一区二区三区| 欧美精品乱人伦久久久久久| 国产日韩欧美高清在线| 日韩av高清在线观看| 99re8在线精品视频免费播放| 日韩欧美第一区| 亚洲午夜国产一区99re久久| 精品一区二区三区日韩| 欧美午夜一区二区三区免费大片| 精品动漫一区二区三区在线观看 | av日韩在线网站| 精品免费视频.| 五月天激情综合网| 色婷婷亚洲综合| 国产精品美女一区二区| 久久99国产精品久久99果冻传媒| 欧美性猛片xxxx免费看久爱| 国产精品进线69影院| 国产成人啪免费观看软件| 亚洲精品一区二区三区四区高清| 亚洲国产日韩a在线播放| 色网站国产精品| 亚洲欧美激情插| 99久久国产免费看| 国产精品久久久久久久久免费桃花 | 国内精品在线播放| 69堂国产成人免费视频| 亚洲小说欧美激情另类| 色偷偷88欧美精品久久久| 国产精品久久久久久妇女6080| 国产乱码字幕精品高清av| 91精品国产色综合久久不卡蜜臀| 午夜精品福利一区二区蜜股av| 日本高清视频一区二区| 亚洲激情一二三区| 91黄视频在线| 丝袜美腿亚洲一区| 欧美丰满一区二区免费视频| 五月综合激情网| 日韩视频一区在线观看| 久久精品久久精品| 久久久亚洲精品石原莉奈| 国产精品影音先锋| 欧美国产日韩一二三区| 91丨九色丨国产丨porny| 一区二区在线免费观看| 欧美日韩在线电影| 麻豆精品久久精品色综合| 久久综合网色—综合色88| 国产精品一区二区不卡| 日韩一区中文字幕| 在线精品视频免费播放| 日韩高清一区二区| 国产色91在线| 欧美在线啊v一区| 久久国产婷婷国产香蕉| 中文字幕一区二区5566日韩| 欧美日韩不卡一区| 国产在线视视频有精品| 中文字幕视频一区| 欧美精品1区2区| 激情综合一区二区三区| 国产精品久久99| 91精品国产色综合久久久蜜香臀| 国产一区二区在线免费观看| 中文字幕一区二区三区在线观看| 欧美系列一区二区| 国产老肥熟一区二区三区| 亚洲精品高清视频在线观看| 精品国产精品一区二区夜夜嗨| 成人18视频在线播放| 奇米色一区二区三区四区| 国产精品理论在线观看| 欧美一区二区三区四区久久| 福利电影一区二区| 日日嗨av一区二区三区四区| 国产精品久久国产精麻豆99网站| 91超碰这里只有精品国产| 粉嫩aⅴ一区二区三区四区五区| 午夜伦理一区二区| 亚洲欧洲国产日本综合| 精品sm在线观看| 在线不卡中文字幕播放| 99久久精品国产观看| 久久99久久久欧美国产| 亚洲一区二区黄色| 国产精品白丝在线| 久久久亚洲综合| 日韩精品专区在线| 7777精品伊人久久久大香线蕉最新版| av资源站一区| 国产成人午夜精品影院观看视频| 麻豆成人综合网| 日韩精品成人一区二区在线| 亚洲综合区在线| 亚洲青青青在线视频| 中文乱码免费一区二区| 久久亚洲精品国产精品紫薇| 欧美一二三区精品| 欧美精品一二三| 欧美日韩卡一卡二| 日本道色综合久久| 91天堂素人约啪| 91亚洲精品久久久蜜桃| 成人一区二区三区视频| 国产激情视频一区二区三区欧美| 精品一二三四在线| 国产精品1024久久| 国产乱码精品一品二品| 国产乱一区二区| 国产激情一区二区三区| 国产高清视频一区| 国产精品69毛片高清亚洲| 国产91色综合久久免费分享| 国产精品一区二区91| a美女胸又www黄视频久久| 99久久精品免费精品国产| 色婷婷综合久久久中文一区二区 | 91麻豆精品国产| 91精品国产一区二区人妖| 精品国产免费视频| 久久久久国产一区二区三区四区| 国产日韩综合av| 综合在线观看色| 亚洲影视在线播放| 丝袜美腿亚洲色图| 国产呦萝稀缺另类资源| 豆国产96在线|亚洲| 色婷婷亚洲综合| 日韩欧美国产系列| 中文字幕欧美三区| 亚洲国产中文字幕在线视频综合 | 国产99一区视频免费| 91看片淫黄大片一级在线观看| 色吧成人激情小说| 日韩午夜在线观看| 国产精品色哟哟| 午夜久久久久久久久久一区二区| 久久99国产精品麻豆| 91蜜桃在线免费视频| 国产偷国产偷亚洲高清人白洁| 国产精品女人毛片| 性做久久久久久| 国产一区二区三区国产| 在线观看日韩毛片| 久久免费精品国产久精品久久久久| 中文字幕一区二区5566日韩| 蜜臀av性久久久久蜜臀aⅴ | 一区二区三区日韩| 美日韩一区二区三区| 99国内精品久久| 欧美日韩另类一区| 国产精品情趣视频| 理论电影国产精品| 一本大道av一区二区在线播放| 精品精品国产高清a毛片牛牛| 亚洲欧美综合在线精品| 麻豆视频观看网址久久| 欧美艳星brazzers| 中文字幕高清一区| 六月丁香婷婷色狠狠久久| 欧美日韩另类一区| 亚洲欧美国产高清|