• 大小: 198KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: 其他
  • 标签: RFID  C#  SIEMENS  

资源简介

西门子RFID读写程序,读取和写入信息,包含详细的日志。

资源截图

代码片段和文件信息

using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types; 
using System.Globalization;

namespace cdcontrol
{
    /// 
    /// Oracledata 的摘要说明。
    /// 

    public class Oracledata
    {
        public OracleConnection dbConnection;
        public OracleCommand cmd;
        private OracleDataReader dataReader;
        private OracleDataAdapter dataAdapter;

        public Oracledata()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }

        //同一程序中多次使用,第二次使用时,需先把CMD注销
        public void TempDispose()
        {
            if (cmd != null)
            {
                cmd.Dispose();
            }
        }

        public void Open()
        {
            string cn = ““;
            if (System.Configuration.ConfigurationManager.ConnectionStrings[“ConnectionString“] != null)
            {
                cn = System.Configuration.ConfigurationManager.ConnectionStrings[“ConnectionString“].ToString();
            }
            else
            {
                cn = “Password=VGSM;User ID=VGSM;Data Source=VGSM;“;
            }
            dbConnection = new Oracle.DataAccess.Client.OracleConnection(cn);
            dbConnection.Open();

        }

        public void Open(string cn)
        {
            dbConnection = new Oracle.DataAccess.Client.OracleConnection(cn);
            dbConnection.Open();
        }

        public void OpenConn(string cn)
        {
            dbConnection = new Oracle.DataAccess.Client.OracleConnection(cn);

            dbConnection.Open();
        }

        public void Close()
        {
            if (cmd != null)
            {
                cmd.Dispose();
                dbConnection.Close();
                dbConnection.Dispose();
            }
        }

        //直接运行SQL语句
        public void dosql(string sql)
        {
            try
            {
            cmd = dbConnection.CreateCommand();
            cmd.CommandText = sql;
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            }
            catch (Exception ex) // catches any error
            {
                throw new Exception(“出错:“+ex.Message.ToString());
               // string s = ex.Message.ToString();
            }
        }
        public int ExecuteSql(string[] strSql)
        {
            //用途:批执行SQL语句,如果中间出错,事物回滚。
            //输入参数:strSql[] —— sql字符串数组
            //输出结果:如果执行成功返回“”,如果出错返回经过处理的出错信息。
           
            int S_Temp = 1;
            OracleTransaction Trans;
            Open();
            cmd = dbConnection.CreateCommand();
            Trans = dbConnection.BeginTransaction();
            
            try
            {
                //依次执行传入的SQL语句
                for (int i = 0; i < strSql.Length; i++)
                {
                    if (strSql[i].ToString() != ““)
           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4490  2013-06-13 10:58  RFReader.TestApp\cdcontrol\cdcontrol.csproj

     文件        257  2013-06-13 10:58  RFReader.TestApp\cdcontrol\cdcontrol.csproj.vspscc

     文件      51754  2013-06-13 10:58  RFReader.TestApp\cdcontrol\oracleclass\Oracledata.cs

     文件       1393  2013-06-13 10:58  RFReader.TestApp\cdcontrol\Properties\AssemblyInfo.cs

     文件        705  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\About_Dialog.cs

     文件       4147  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\About_Dialog.Designer.cs

     文件       6011  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\About_Dialog.resx

     文件       5274  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Address_Dialog.cs

     文件      13909  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Address_Dialog.Designer.cs

     文件       6011  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Address_Dialog.resx

     文件       3543  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Antenna_Dialog.cs

     文件      16858  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Antenna_Dialog.Designer.cs

     文件       5814  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Antenna_Dialog.resx

     文件       2402  2013-06-13 11:17  RFReader.TestApp\RFReader.TestApp\Config_Dialog.cs

     文件       4936  2013-06-13 11:17  RFReader.TestApp\RFReader.TestApp\Config_Dialog.Designer.cs

     文件       5814  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Config_Dialog.resx

     文件       1404  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\GetTagID_Dialog.cs

     文件       6024  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\GetTagID_Dialog.Designer.cs

     文件       5814  2013-06-13 10:59  RFReader.TestApp\RFReader.TestApp\GetTagID_Dialog.resx

     文件       3027  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\HfConfig_Dialog.cs

     文件       9122  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\HfConfig_Dialog.Designer.cs

     文件       6011  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\HfConfig_Dialog.resx

     文件       7623  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\IpAddress_Dialog.cs

     文件      10990  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\IpAddress_Dialog.Designer.cs

     文件       5814  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\IpAddress_Dialog.resx

     文件       1558  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Kill_Dialog.cs

     文件       6118  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Kill_Dialog.Designer.cs

     文件       6011  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Kill_Dialog.resx

     文件       2183  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Lock_Dialog.cs

     文件       8312  2013-06-13 10:58  RFReader.TestApp\RFReader.TestApp\Lock_Dialog.Designer.cs

............此处省略106个文件信息

评论

共有 条评论