Commit c064edb2 顾剑亮

upload

1 个父辈 2f28bb24
正在显示 290 个修改的文件 包含 163 行增加1770 行删除
{
"CurrentProjectSetting": null
}
\ No newline at end of file
此文件类型无法预览
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
此文件类型无法预览
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Asa.RFID
{
/// <summary>
/// 读取所有RFID
/// </summary>
public class ReadAll2 : IReadAll
{
private HiStation[] _device;
private Dictionary<string, string> _id; //RFID编号
private string _logName;
public event IReadAll.ReceivedEvent Received;
public event IReadAll.ReceiveBufferEvent ReceiveBuffer;
/// <summary>
/// 读取所有RFID
/// </summary>
/// <param name="logName">日志名称</param>
public ReadAll2(string logName = "HFReader")
{
_logName = logName;
_id = new Dictionary<string, string>();
if (Common.log == null)
Common.log = log4net.LogManager.GetLogger(logName);
}
public void Start(int port)
{
}
/// <summary>
/// 开启
/// </summary>
/// <param name="ip"></param>
public void Start(string[] ip)
{
try
{
_id.Clear();
_device = new HiStation[ip.Length];
for (int i = 0; i < _device.Length; i++)
{
_id.Add(ip[i], "000");
_device[i] = new HiStation(_logName) { IP = ip[i] };
_device[i].Connected += ReadAll_Connected;
_device[i].Received += ReadAll_Received;
_device[i].Open();
}
Common.log.Info("Server Start");
}
catch (Exception ex)
{
Common.log.Error("Start", ex);
}
}
/// <summary>
/// 停止
/// </summary>
public void Stop()
{
if (_device != null)
{
for (int i = 0; i < _device.Length; i++)
{
try
{
_device[i].TriggerMode(false);
System.Threading.Thread.Sleep(50);
_device[i].Close();
}
catch (Exception ex)
{
Common.log.Error("Stop", ex);
}
}
}
_device = null;
Common.log.Info("Server Stop");
}
/// <summary>
/// 读取ID号
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public string Read(string ip)
{
if (_id.TryGetValue(ip, out string value))
{
Common.log.Info("[" + ip + "]Read " + value);
return value;
}
else
{
Common.log.Info("[" + ip + "]Read 没有找到");
return "000";
}
}
/// <summary>
/// 清除缓存
/// </summary>
/// <param name="ip"></param>
public void Clear(string ip)
{
if (_id.ContainsKey(ip))
{
_id[ip] = "000";
Common.log.Info("[" + ip + "]Clear");
}
else
{
Common.log.Info("[" + ip + "]Clear 没有找到");
}
}
private void ReadAll_Connected(string ip)
{
int index = -1;
foreach (var ss in _id.Keys)
{
index++;
if (ss == ip)
break;
}
if (index != -1)
_device[index].TriggerMode(true);
}
private void ReadAll_Received(string ip, string uid, string data)
{
Common.log.Debug("Received IP=" + ip + " uid=" + uid + " data=" + data);
if (_id[ip] == data)
{
}
else
{
_id[ip] = data;
Received?.Invoke(ip, data);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Asa.RFID
{
public static class Common
{
public static log4net.ILog log = null;
}
}
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.pdb
D:\Neotel\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.dll
D:\Neotel\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.pdb
D:\Neotel\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.dll
D:\Neotel\RFID\RFID-HiStation\bin\Debug\log4net.dll
D:\Neotel\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.pdb
D:\Neotel\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csprojAssemblyReference.cache
D:\Neotel\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CoreCompileInputs.cache
D:\Neotel\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CopyComplete
D:\Neotel\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.dll
D:\Neotel\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.pdb
C:\Neotel\Program\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.dll
C:\Neotel\Program\RFID\RFID-HiStation\bin\Debug\Asa.RFID.HiStation.pdb
C:\Neotel\Program\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.dll
C:\Neotel\Program\RFID\RFID-HiStation\bin\Debug\Asa.RFID.IReadAll.pdb
C:\Neotel\Program\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csprojAssemblyReference.cache
C:\Neotel\Program\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CoreCompileInputs.cache
C:\Neotel\Program\RFID\RFID-HiStation\obj\Debug\RFID-HiStation.csproj.CopyComplete
C:\Neotel\Program\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.dll
C:\Neotel\Program\RFID\RFID-HiStation\obj\Debug\Asa.RFID.HiStation.pdb

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
VisualStudioVersion = 16.0.31112.23
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID", "RFID\RFID.csproj", "{CF083E56-FA69-4893-90C4-6D0430ADC03F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFIDReadAll", "RFIDReadAll\RFIDReadAll.csproj", "{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_Debug", "RFID_Debug\RFID_Debug.csproj", "{44467E65-C850-4538-96E4-1335CCCB87BC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{1D69196B-2321-4824-B684-50010DD43702}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_HFReader", "RFID_HFReader\RFID_HFReader.csproj", "{E352E032-435C-4EB1-96B4-018BDC50B105}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_HaoBin", "RFID_HaoBin\RFID_HaoBin.csproj", "{6B0B49DF-B379-49C6-9983-6C9076F99711}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_HFReader_Debug", "RFID_HFReader_Debug\RFID_HFReader_Debug.csproj", "{5C55663B-DBDA-490B-A80F-0ABB173AEF88}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_PuYue", "RFID_PuYue\RFID_PuYue.csproj", "{6AFA3060-1DFF-4AC0-B082-827C451E5FF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_Interface", "RFID_Interface\RFID_Interface.csproj", "{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_HaoBin_Debug", "RFID_HaoBin_Debug\RFID_HaoBin_Debug.csproj", "{9EB46CB8-79C8-4E19-B04B-EABE52C54E33}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID-HiStation", "RFID-HiStation\RFID-HiStation.csproj", "{4D5996F8-7206-480D-834A-BE1DB5FB05B2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFID_PuYue_Debug", "RFID_PuYue_Debug\RFID_PuYue_Debug.csproj", "{1ED209BC-07E5-48AC-AFD3-21E5E3D58B6E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Debug|x86.ActiveCfg = Debug|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Debug|x86.Build.0 = Debug|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Release|Any CPU.Build.0 = Release|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Release|x86.ActiveCfg = Release|Any CPU
{CF083E56-FA69-4893-90C4-6D0430ADC03F}.Release|x86.Build.0 = Release|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Debug|x86.ActiveCfg = Debug|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Debug|x86.Build.0 = Debug|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Release|Any CPU.Build.0 = Release|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Release|x86.ActiveCfg = Release|Any CPU
{44467E65-C850-4538-96E4-1335CCCB87BC}.Release|x86.Build.0 = Release|Any CPU
{E352E032-435C-4EB1-96B4-018BDC50B105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E352E032-435C-4EB1-96B4-018BDC50B105}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E352E032-435C-4EB1-96B4-018BDC50B105}.Debug|x86.ActiveCfg = Debug|x86
{E352E032-435C-4EB1-96B4-018BDC50B105}.Debug|x86.Build.0 = Debug|x86
{E352E032-435C-4EB1-96B4-018BDC50B105}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E352E032-435C-4EB1-96B4-018BDC50B105}.Release|Any CPU.Build.0 = Release|Any CPU
{E352E032-435C-4EB1-96B4-018BDC50B105}.Release|x86.ActiveCfg = Release|x86
{E352E032-435C-4EB1-96B4-018BDC50B105}.Release|x86.Build.0 = Release|x86
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Debug|x86.ActiveCfg = Debug|x86
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Debug|x86.Build.0 = Debug|x86
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Release|Any CPU.Build.0 = Release|Any CPU
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Release|x86.ActiveCfg = Release|x86
{5C55663B-DBDA-490B-A80F-0ABB173AEF88}.Release|x86.Build.0 = Release|x86
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Debug|x86.ActiveCfg = Debug|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Debug|x86.Build.0 = Debug|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Release|Any CPU.Build.0 = Release|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Release|x86.ActiveCfg = Release|Any CPU
{E7A36C72-093B-428E-A4E3-4739EE0BF4CC}.Release|x86.Build.0 = Release|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Debug|x86.Build.0 = Debug|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Release|Any CPU.Build.0 = Release|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Release|x86.ActiveCfg = Release|Any CPU
{4D5996F8-7206-480D-834A-BE1DB5FB05B2}.Release|x86.Build.0 = Release|Any CPU
{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}.Release|Any CPU.Build.0 = Release|Any CPU
{1D69196B-2321-4824-B684-50010DD43702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D69196B-2321-4824-B684-50010DD43702}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D69196B-2321-4824-B684-50010DD43702}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D69196B-2321-4824-B684-50010DD43702}.Release|Any CPU.Build.0 = Release|Any CPU
{6B0B49DF-B379-49C6-9983-6C9076F99711}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B0B49DF-B379-49C6-9983-6C9076F99711}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B0B49DF-B379-49C6-9983-6C9076F99711}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B0B49DF-B379-49C6-9983-6C9076F99711}.Release|Any CPU.Build.0 = Release|Any CPU
{6AFA3060-1DFF-4AC0-B082-827C451E5FF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AFA3060-1DFF-4AC0-B082-827C451E5FF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AFA3060-1DFF-4AC0-B082-827C451E5FF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AFA3060-1DFF-4AC0-B082-827C451E5FF7}.Release|Any CPU.Build.0 = Release|Any CPU
{9EB46CB8-79C8-4E19-B04B-EABE52C54E33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9EB46CB8-79C8-4E19-B04B-EABE52C54E33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EB46CB8-79C8-4E19-B04B-EABE52C54E33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EB46CB8-79C8-4E19-B04B-EABE52C54E33}.Release|Any CPU.Build.0 = Release|Any CPU
{1ED209BC-07E5-48AC-AFD3-21E5E3D58B6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ED209BC-07E5-48AC-AFD3-21E5E3D58B6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ED209BC-07E5-48AC-AFD3-21E5E3D58B6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ED209BC-07E5-48AC-AFD3-21E5E3D58B6E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A8311F25-CF54-49C8-8F94-BC7576D497F3}
SolutionGuid = {D46FD659-1323-49C4-96F9-F5DA44E899AB}
EndGlobalSection
EndGlobal
此文件类型无法预览
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\obj\Debug\RFID.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\obj\Debug\RFID.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\obj\Debug\RFID.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\bin\Debug\Asa.RFID.HFRead.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\bin\Debug\Asa.RFID.HFRead.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\bin\Debug\Asa.RFID.HFRead.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\bin\Debug\Asa.RFID.IReadAll.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\bin\Debug\Asa.RFID.IReadAll.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\obj\Debug\Asa.RFID.HFRead.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID\obj\Debug\Asa.RFID.HFRead.pdb
using System;
namespace Asa.RFID
{
internal class Client
{
public bool Loop;
public string IP;
public bool IsConn;
public System.Collections.Generic.List<byte> Buffer;
public System.Net.Sockets.Socket Socket;
public System.Threading.Thread ListenNet;
public Client(string ip, System.Net.Sockets.Socket socket, System.Threading.Thread listenNet)
{
Loop = true;
IP = ip;
IsConn = true;
Buffer = new System.Collections.Generic.List<byte>();
Socket = socket;
ListenNet = listenNet;
}
}
}
......@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RFID")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("cf083e56-fa69-4893-90c4-6d0430adc03f")]
[assembly: Guid("81468fba-fd2c-42e8-b116-b0d9ab1cbd7f")]
// 程序集的版本信息由下列四个值组成:
//
......@@ -34,3 +34,5 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
\ No newline at end of file
......@@ -4,11 +4,11 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CF083E56-FA69-4893-90C4-6D0430ADC03F}</ProjectGuid>
<ProjectGuid>{81468FBA-FD2C-42E8-B116-B0D9AB1CBD7F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Asa.RFID</RootNamespace>
<AssemblyName>Asa.RFID.HFRead</AssemblyName>
<AssemblyName>Asa.RFID.ReadAll</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
......@@ -21,8 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Asa.RFID.HFRead.xml</DocumentationFile>
<LangVersion>8.0</LangVersion>
<DocumentationFile>bin\Debug\Asa.RFID.ReadAll.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -31,14 +30,15 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\DLL\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
......@@ -47,14 +47,13 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HFReader1.cs" />
<Compile Include="Client.cs" />
<Compile Include="ReadAll.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Type.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RFID_Interface\RFID_Interface.csproj">
<Project>{e7a36c72-093b-428e-a4e3-4739ee0bf4cc}</Project>
<Name>RFID_Interface</Name>
</ProjectReference>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
......
此文件的差异被折叠, 点击展开。
using System;
namespace Asa.RFID
{
/// <summary>
/// RFID读卡器类型
/// </summary>
public enum DeviceType
{
/// <summary>
/// 普阅(新)
/// </summary>
PuYue,
/// <summary>
/// 浩斌(旧)
/// </summary>
HaoBin
}
}
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID</name>
<name>Asa.RFID.ReadAll</name>
</assembly>
<members>
<member name="T:Asa.RFID.ReadAll">
......@@ -9,59 +9,69 @@
读取所有RFID
</summary>
</member>
<member name="T:Asa.RFID.ReadAll.ReceivedEvent">
<member name="M:Asa.RFID.ReadAll.#ctor(System.String)">
<summary>
接收数据包事件
读取所有RFID
</summary>
<param name="ip"></param>
<param name="id"></param>
<param name="logName">日志名称</param>
</member>
<member name="E:Asa.RFID.ReadAll.Received">
<member name="P:Asa.RFID.ReadAll.Type">
<summary>
接收数据包
设备类型
</summary>
</member>
<member name="T:Asa.RFID.ReadAll.ReceiveBufferEvent">
<member name="M:Asa.RFID.ReadAll.Start(System.Int32)">
<summary>
接收网卡缓存事件
开始
</summary>
<param name="ip"></param>
<param name="buffer"></param>
<param name="port">端口号</param>
</member>
<member name="E:Asa.RFID.ReadAll.ReceiveBuffer">
<member name="M:Asa.RFID.ReadAll.Stop">
<summary>
接收网卡缓存
停止
</summary>
</member>
<member name="M:Asa.RFID.ReadAll.#ctor(System.String)">
<member name="M:Asa.RFID.ReadAll.Read(System.String,System.String)">
<summary>
读取所有RFID
读取
</summary>
<param name="logName">日志名称</param>
<param name="ip">IP地址</param>
<param name="defaultID">没有找到时返回</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReadAll.Start(System.Int32)">
<member name="M:Asa.RFID.ReadAll.Read(System.String)">
<summary>
开启
读取所有
</summary>
<param name="port">RFID设备的端口</param>
<param name="defaultID">没有数据时返回</param>
</member>
<member name="M:Asa.RFID.ReadAll.Stop">
<member name="M:Asa.RFID.ReadAll.Clear(System.String,System.String)">
<summary>
停止
清除缓存
</summary>
<param name="ip">IP地址</param>
<param name="defaultID">设置初始ID</param>
</member>
<member name="M:Asa.RFID.ReadAll.Read(System.String)">
<member name="M:Asa.RFID.ReadAll.Clear(System.String)">
<summary>
读取ID号
清除所有缓存
</summary>
<param name="ip"></param>
<returns></returns>
<param name="defaultID">设置初始ID</param>
</member>
<member name="M:Asa.RFID.ReadAll.Clear(System.String)">
<member name="T:Asa.RFID.DeviceType">
<summary>
清除缓存
RFID读卡器类型
</summary>
</member>
<member name="F:Asa.RFID.DeviceType.PuYue">
<summary>
普阅(新)
</summary>
</member>
<member name="F:Asa.RFID.DeviceType.HaoBin">
<summary>
浩斌(旧)
</summary>
<param name="ip"></param>
</member>
</members>
</doc>
此文件类型无法预览
此文件的差异太大,无法显示。
d69d24ca92ce59f253592160c011f48788aec243
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.xml
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFID\bin\Debug\log4net.dll
C:\Neotel\Program\RFID\RFID\bin\Debug\log4net.xml
C:\Neotel\Program\RFID\RFID\obj\Debug\RFID.csprojAssemblyReference.cache
C:\Neotel\Program\RFID\RFID\obj\Debug\RFID.csproj.CoreCompileInputs.cache
C:\Neotel\Program\RFID\RFID\obj\Debug\RFID.csproj.CopyComplete
C:\Neotel\Program\RFID\RFID\obj\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFID\obj\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.xml
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFID\bin\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFID\bin\Debug\log4net.dll
C:\Neotel\Program\RFID\RFID\bin\Debug\log4net.xml
C:\Neotel\Program\RFID\RFID\obj\Debug\RFIDReadAll.csproj.CoreCompileInputs.cache
C:\Neotel\Program\RFID\RFID\obj\Debug\RFIDReadAll.csproj.CopyComplete
C:\Neotel\Program\RFID\RFID\obj\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFID\obj\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFIDReadAll\bin\Debug\Asa.RFID.ReadAll.xml
C:\Neotel\Program\RFID\RFIDReadAll\bin\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFIDReadAll\bin\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFIDReadAll\bin\Debug\log4net.dll
C:\Neotel\Program\RFID\RFIDReadAll\bin\Debug\log4net.xml
C:\Neotel\Program\RFID\RFIDReadAll\obj\Debug\RFIDReadAll.csproj.CoreCompileInputs.cache
C:\Neotel\Program\RFID\RFIDReadAll\obj\Debug\RFIDReadAll.csproj.CopyComplete
C:\Neotel\Program\RFID\RFIDReadAll\obj\Debug\Asa.RFID.ReadAll.dll
C:\Neotel\Program\RFID\RFIDReadAll\obj\Debug\Asa.RFID.ReadAll.pdb
C:\Neotel\Program\RFID\RFIDReadAll\obj\Debug\RFIDReadAll.csprojAssemblyReference.cache
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/ACStore-RC29-1.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="Debug"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/ACStore-RC29-1.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="Debug"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
</configuration>
\ No newline at end of file
此文件类型无法预览
此文件的差异太大,无法显示。
[2020-05-18 19:26:35,552][1]INFO aa
[2020-05-18 19:26:46,230][1]INFO Server Start
[2020-05-18 19:26:53,811][1]INFO Server Stop
[2020-05-18 19:26:53,836][3]ERROR Socket Close
[2020-05-18 20:01:28,262][1]INFO Server Start
[2020-05-18 20:02:26,513][1]INFO Server Start
[2020-05-18 20:02:31,438][1]INFO Server Stop
[2020-05-18 20:02:31,457][3]ERROR Socket Close
[2020-05-18 20:03:21,924][1]INFO Server Start
[2020-05-18 20:03:44,909][1]INFO Server Stop
[2020-05-18 20:03:44,926][3]ERROR Socket Close
[2020-05-18 20:05:17,709][1]INFO Server Start
[2020-05-18 20:05:20,758][1]INFO Server Stop
[2020-05-18 20:05:20,776][3]ERROR Socket Close
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\RFID_Debug.exe.config
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\RFID_Debug.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\RFID_Debug.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.Form1.resources
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.Properties.Resources.resources
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.csproj.GenerateResource.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\obj\Debug\RFID_Debug.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\Asa.RFID.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\Asa.RFID.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_Debug\bin\Debug\Asa.RFID.xml
using System;
using System.Reflection;
using System.Diagnostics;
namespace Asa.RFID
{
/// <summary>
/// 日志操作类
/// </summary>
internal class Log
{
private bool exit = false;
private int day = 0;
private string fileName;
private string filePath = "";
private System.Collections.Concurrent.ConcurrentQueue<string> _info;
private System.Threading.Thread tSave;
private readonly string _path;
private StackTrace trace;
private StackFrame frame;
private MethodBase method;
/// <summary>
/// 日志
/// </summary>
/// <param name="path">文件夹目录</param>
public Log(string path)
{
fileName = null;
if (string.IsNullOrWhiteSpace(path))
{
_path = "";
}
else
{
_path = path.EndsWith("\\") ? path : path + "\\";
if (!System.IO.Directory.Exists(_path))
System.IO.Directory.CreateDirectory(_path);
}
_info = new System.Collections.Concurrent.ConcurrentQueue<string>();
tSave = new System.Threading.Thread(new System.Threading.ThreadStart(SaveLog));
tSave.Start();
}
/// <summary>
/// 日志
/// </summary>
/// <param name="path">文件夹目录</param>
/// <param name="name">文件名</param>
public Log(string path, string name) : this(path)
{
fileName = name;
}
/// <summary>
/// 退出
/// </summary>
public void Exit()
{
exit = true;
}
/// <summary>
/// 输出错误信息
/// </summary>
/// <param name="s"></param>
public void OutError(string s)
{
if (string.IsNullOrWhiteSpace(s)) return;
trace = new StackTrace(true);
frame = trace.GetFrame(1);
string name = frame.GetFileName();
name = System.IO.Path.GetFileName(name);
string log = string.Format("[{0:HH:mm:ss.fff}] ERROR {1}({2},{3})\r\n",
DateTime.Now, name, frame.GetFileLineNumber(), frame.GetFileColumnNumber());
string[] arr = new string[trace.FrameCount - 1];
for (int i = 1; i < trace.FrameCount; i++) //0是本身Out
{
method = trace.GetFrame(i).GetMethod();
arr[arr.Length - i] = " " + method.DeclaringType.FullName + " -> " + method.ToString();
}
log += string.Join("\r\n", arr) + string.Format("\r\n {0}\r\n", s);
_info.Enqueue(log);
}
/// <summary>
/// 输出信息
/// </summary>
/// <param name="s"></param>
public void OutInfo(string s)
{
if (string.IsNullOrWhiteSpace(s)) return;
trace = new StackTrace(true);
frame = trace.GetFrame(1);
method = trace.GetFrame(1).GetMethod();
string name = frame.GetFileName();
name = System.IO.Path.GetFileName(name);
string s1 = method.DeclaringType.FullName;
string s2 = method.Name;
string log = string.Format("[{0:HH:mm:ss.fff}] INFO {1}({2},{3}) {4}->{5} {6}\r\n",
DateTime.Now, name, frame.GetFileLineNumber(), frame.GetFileColumnNumber(), s1, s2, s);
_info.Enqueue(log);
}
/// <summary>
/// 输出调试信息
/// </summary>
/// <param name="s"></param>
public void OutDebug(string s)
{
if (string.IsNullOrWhiteSpace(s)) return;
trace = new StackTrace(true);
frame = trace.GetFrame(1);
string name = frame.GetFileName();
name = System.IO.Path.GetFileName(name);
string log = string.Format("[{0:HH:mm:ss.fff}] DEBUG {1}({2},{3})\r\n",
DateTime.Now, name, frame.GetFileLineNumber(), frame.GetFileColumnNumber());
string[] arr = new string[trace.FrameCount];
for (int i = 0; i < trace.FrameCount; i++)
{
method = trace.GetFrame(i).GetMethod();
arr[arr.Length - i - 1] = " " + method.DeclaringType.FullName + " -> " + method.ToString();
}
log += string.Join("\r\n", arr) + string.Format("\r\n {0}\r\n", s);
_info.Enqueue(log);
}
/// <summary>
/// 输出字符串数据
/// </summary>
/// <param name="s"></param>
public void OutString(string s)
{
if (string.IsNullOrEmpty(s)) return;
string log = string.Format("[{0:HH:mm:ss.fff}] {1}\r\n", DateTime.Now, s);
_info.Enqueue(log);
}
private void SaveLog()
{
while (true)
{
System.Threading.Thread.Sleep(5);
if (_info.TryDequeue(out string result))
{
try
{
SaveFile(result);
}
catch (ObjectDisposedException odex)
{
break;
}
catch (Exception ex)
{
}
}
if (exit)
{
if (_info.Count == 0)
break;
}
}
}
private void SaveFile(string log)
{
if (_path == "") return;
if (day != DateTime.Now.Day)
{
if (fileName == null)
{
filePath = string.Format("{0}{1:yyyy-MM-dd}.log", _path, DateTime.Now);
}
else
{
filePath = string.Format("{0}{1:yyyy-MM-dd}\\", _path, DateTime.Now);
System.IO.Directory.CreateDirectory(filePath);
filePath += fileName + ".log";
}
day = DateTime.Now.Day;
}
byte[] array = System.Text.Encoding.UTF8.GetBytes(log);
System.IO.FileStream fs = System.IO.File.OpenWrite(filePath);
fs.Position = fs.Length;
fs.Write(array, 0, array.Length);
fs.Close();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E352E032-435C-4EB1-96B4-018BDC50B105}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Asa.RFID</RootNamespace>
<AssemblyName>Asa.RFID.HFReader</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Asa.RFID.HFReader.xml</DocumentationFile>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\Asa.RFID.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\DLL\RFID\HFReader9CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Class2.cs" />
<Compile Include="Common.cs" />
<Compile Include="Log.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID</name>
</assembly>
<members>
<member name="T:Asa.RFID.Reader">
<summary>
RFID读卡器
</summary>
</member>
<member name="T:Asa.RFID.Reader.Received_Event">
<summary>
接收事件
</summary>
<param name="ip"></param>
<param name="buff"></param>
</member>
<member name="E:Asa.RFID.Reader.Received">
<summary>
接收数据
</summary>
</member>
<member name="M:Asa.RFID.Reader.#ctor(System.String)">
<summary>
RFID读卡器
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsConn">
<summary>
是否连接
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsAutoScan">
<summary>
是否自动扫描
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsExist">
<summary>
是否存在ID卡
</summary>
</member>
<member name="P:Asa.RFID.Reader.ErrCode">
<summary>
错误代码
</summary>
</member>
<member name="P:Asa.RFID.Reader.IP">
<summary>
IP地址
</summary>
</member>
<member name="P:Asa.RFID.Reader.LogPath">
<summary>
日志目录
</summary>
</member>
<member name="P:Asa.RFID.Reader.ID">
<summary>
ID号码
</summary>
</member>
<member name="M:Asa.RFID.Reader.Open(System.Boolean)">
<summary>
连接
</summary>
<param name="autoScan">自动扫描</param>
</member>
<member name="M:Asa.RFID.Reader.Close">
<summary>
关闭
</summary>
</member>
<member name="M:Asa.RFID.Reader.FindRFID">
<summary>
查找电子标签,扫描模式不能使用
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Read">
<summary>
读取电子标签
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Write(System.Byte[])">
<summary>
写入数据到电子标签,扫描模式不能使用
</summary>
<param name="buff">数据,必须小于等于112字节</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.AutoScanMode(System.Boolean)">
<summary>
自动扫描模式
</summary>
<param name="open"></param>
<param name="open2"></param>
<returns></returns>
</member>
<member name="T:Asa.RFID.ReaderAll">
<summary>
RFID读卡器
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.#ctor">
<summary>
RFID
</summary>
</member>
<member name="P:Asa.RFID.ReaderAll.LogPath">
<summary>
日志目录
</summary>
</member>
<member name="P:Asa.RFID.ReaderAll.ScanMode">
<summary>
扫描模式,true自动,false查找
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.Open(System.String[])">
<summary>
打开所有
</summary>
<param name="ip"></param>
</member>
<member name="M:Asa.RFID.ReaderAll.Close">
<summary>
关闭所有
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.IsOpen">
<summary>
是否打开
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.IsOpen(System.String)">
<summary>
是否打开
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.Read(System.String)">
<summary>
读取
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.ReadStr(System.String)">
<summary>
读取
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.Clear(System.String)">
<summary>
清零
</summary>
<param name="ip"></param>
</member>
<member name="T:Asa.RFID.IP">
<summary>
IP地址操作
</summary>
</member>
<member name="M:Asa.RFID.IP.Find(System.String)">
<summary>
查找IP地址
</summary>
<param name="localIP"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.Modify(System.String,System.String,System.String)">
<summary>
修改IP地址,需要先查找IP
</summary>
<param name="localIP">本地IP</param>
<param name="beforeIP">修改前的IP</param>
<param name="afterIP">修改后的IP</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.GetLocal">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member name="T:Asa.RFID.Log">
<summary>
日志操作类
</summary>
</member>
<member name="M:Asa.RFID.Log.#ctor(System.String)">
<summary>
日志
</summary>
<param name="path">文件夹目录</param>
</member>
<member name="M:Asa.RFID.Log.#ctor(System.String,System.String)">
<summary>
日志
</summary>
<param name="path">文件夹目录</param>
<param name="name">文件名</param>
</member>
<member name="M:Asa.RFID.Log.Exit">
<summary>
退出
</summary>
</member>
<member name="M:Asa.RFID.Log.OutError(System.String)">
<summary>
输出错误信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutInfo(System.String)">
<summary>
输出信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutDebug(System.String)">
<summary>
输出调试信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutString(System.String)">
<summary>
输出字符串数据
</summary>
<param name="s"></param>
</member>
</members>
</doc>
C:\MY\DLL Coding\RFID\bin\Debug\Asa.RFID.xml
C:\MY\DLL Coding\RFID\bin\Debug\Asa.RFID.dll
C:\MY\DLL Coding\RFID\bin\Debug\Asa.RFID.pdb
C:\MY\DLL Coding\RFID\obj\Debug\Asa.RFID.dll
C:\MY\DLL Coding\RFID\obj\Debug\Asa.RFID.pdb
C:\MY\DLL Coding\RFID\bin\Debug\HFReader9CSharp.dll
C:\MY\DLL Coding\RFID\obj\Debug\RFID.csproj.CopyComplete
C:\MY\DLL Coding\RFID\obj\Debug\RFID.csprojAssemblyReference.cache
C:\SMD\DLL\RFID\bin\Debug\Asa.RFID.xml
C:\SMD\DLL\RFID\bin\Debug\Asa.RFID.dll
C:\SMD\DLL\RFID\bin\Debug\Asa.RFID.pdb
C:\SMD\DLL\RFID\bin\Debug\HFReader9CSharp.dll
C:\SMD\DLL\RFID\obj\Debug\RFID.csproj.CopyComplete
C:\SMD\DLL\RFID\obj\Debug\Asa.RFID.dll
C:\SMD\DLL\RFID\obj\Debug\Asa.RFID.pdb
C:\SMD\DLL\RFID\obj\Debug\RFID.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\bin\Debug\Asa.RFID.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\bin\Debug\Asa.RFID.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\bin\Debug\Asa.RFID.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\bin\Debug\HFReader9CSharp.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\obj\Debug\RFID.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\obj\Debug\RFID.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\obj\Debug\Asa.RFID.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\obj\Debug\Asa.RFID.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\DLL\RFID\obj\Debug\RFID.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.HFReader.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.HFReader.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.HFReader.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\HFReader9CSharp.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\RFID_HFReader.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\RFID_HFReader.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\Asa.RFID.HFReader.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\Asa.RFID.HFReader.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\bin\Debug\Asa.RFID.HFReader.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\bin\Debug\Asa.RFID.HFReader.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\bin\Debug\Asa.RFID.HFReader.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\obj\Debug\RFID_HFReader.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\obj\Debug\RFID_HFReader.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\obj\Debug\Asa.RFID.HFReader.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_HFReader\obj\Debug\Asa.RFID.HFReader.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\Asa.RFID.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\RFID_old.csprojAssemblyReference.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\RFID_old.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\RFID_old.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\Asa.RFID.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\obj\Debug\Asa.RFID.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\RFID\RFID_old\bin\Debug\HFReader9CSharp.dll
namespace RFID_Debug
{
partial class FrmMain
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.LstIP = new System.Windows.Forms.ListBox();
this.BtnOpen = new System.Windows.Forms.Button();
this.BtnChangeIP = new System.Windows.Forms.Button();
this.BtnGetIP = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.CboLocal = new System.Windows.Forms.ComboBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.LstIP);
this.groupBox1.Controls.Add(this.BtnOpen);
this.groupBox1.Controls.Add(this.BtnChangeIP);
this.groupBox1.Controls.Add(this.BtnGetIP);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.CboLocal);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(321, 449);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "设备";
//
// button1
//
this.button1.Location = new System.Drawing.Point(235, 379);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 64);
this.button1.TabIndex = 11;
this.button1.Text = "打开所有";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(6, 63);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(223, 29);
this.textBox1.TabIndex = 10;
//
// LstIP
//
this.LstIP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.LstIP.FormattingEnabled = true;
this.LstIP.IntegralHeight = false;
this.LstIP.ItemHeight = 21;
this.LstIP.Location = new System.Drawing.Point(6, 98);
this.LstIP.Name = "LstIP";
this.LstIP.Size = new System.Drawing.Size(223, 345);
this.LstIP.TabIndex = 7;
this.LstIP.SelectedIndexChanged += new System.EventHandler(this.LstIP_SelectedIndexChanged);
//
// BtnOpen
//
this.BtnOpen.Location = new System.Drawing.Point(235, 168);
this.BtnOpen.Name = "BtnOpen";
this.BtnOpen.Size = new System.Drawing.Size(80, 64);
this.BtnOpen.TabIndex = 5;
this.BtnOpen.Text = "打开设备";
this.BtnOpen.UseVisualStyleBackColor = true;
this.BtnOpen.Click += new System.EventHandler(this.BtnOpen_Click);
//
// BtnChangeIP
//
this.BtnChangeIP.Location = new System.Drawing.Point(235, 98);
this.BtnChangeIP.Name = "BtnChangeIP";
this.BtnChangeIP.Size = new System.Drawing.Size(80, 64);
this.BtnChangeIP.TabIndex = 4;
this.BtnChangeIP.Text = "修改设备IP";
this.BtnChangeIP.UseVisualStyleBackColor = true;
this.BtnChangeIP.Click += new System.EventHandler(this.BtnChangeIP_Click);
//
// BtnGetIP
//
this.BtnGetIP.Location = new System.Drawing.Point(235, 28);
this.BtnGetIP.Name = "BtnGetIP";
this.BtnGetIP.Size = new System.Drawing.Size(80, 64);
this.BtnGetIP.TabIndex = 1;
this.BtnGetIP.Text = "获取设备IP";
this.BtnGetIP.UseVisualStyleBackColor = true;
this.BtnGetIP.Click += new System.EventHandler(this.BtnGetIP_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(57, 21);
this.label1.TabIndex = 1;
this.label1.Text = "本地IP";
//
// CboLocal
//
this.CboLocal.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CboLocal.FormattingEnabled = true;
this.CboLocal.Location = new System.Drawing.Point(69, 28);
this.CboLocal.Name = "CboLocal";
this.CboLocal.Size = new System.Drawing.Size(160, 29);
this.CboLocal.TabIndex = 0;
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Location = new System.Drawing.Point(339, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(594, 449);
this.tabControl1.TabIndex = 7;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.textBox2);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.tabPage1.Size = new System.Drawing.Size(586, 423);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.textBox2.Location = new System.Drawing.Point(6, 6);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox2.Size = new System.Drawing.Size(305, 411);
this.textBox2.TabIndex = 0;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(945, 473);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.groupBox1);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "RFID_Debug";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
this.Load += new System.EventHandler(this.FrmMain_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button BtnOpen;
private System.Windows.Forms.Button BtnChangeIP;
private System.Windows.Forms.Button BtnGetIP;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox CboLocal;
private System.Windows.Forms.ListBox LstIP;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TextBox textBox2;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RFID_Debug
{
public partial class FrmMain : Form
{
private bool[] _open;
private string[] _ip;
private Asa.RFID.HFReader[] reader;
private Asa.RFID.HFReaderAll readerAll;
private int sum = 0;
private string currIP = "";
//private Dictionary<string, string> buffer = new Dictionary<string, string>();
private System.Threading.Thread tSave;
private System.Collections.Concurrent.ConcurrentQueue<string> info = new System.Collections.Concurrent.ConcurrentQueue<string>();
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
CboLocal.Items.AddRange(Asa.RFID.IP.GetLocal());
if (CboLocal.Items.Count > 0)
CboLocal.SelectedIndex = 0;
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (tSave != null)
tSave.Abort();
if (reader != null)
{
for (int i = 0; i < reader.Length; i++)
{
reader[i].Close();
System.Threading.Thread.Sleep(10);
}
}
if (readerAll != null)
{
readerAll.Close();
readerAll = null;
}
}
private void BtnGetIP_Click(object sender, EventArgs e)
{
LstIP.Items.Clear();
_ip = Asa.RFID.IP.Find(CboLocal.Text);
LstIP.Items.AddRange(_ip);
_open = new bool[_ip.Length];
}
private void BtnChangeIP_Click(object sender, EventArgs e)
{
if (LstIP.SelectedIndex == -1) return;
bool rtn = Asa.RFID.IP.Modify(CboLocal.Text, LstIP.Text, textBox1.Text);
if (rtn)
MessageBox.Show("修改完成");
else
MessageBox.Show("修改失败", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private void BtnOpen_Click(object sender, EventArgs e)
{
if (LstIP.SelectedIndex == -1) return;
//if (_open[LstIP.SelectedIndex]) return;
TabPage tab = new TabPage { Text = LstIP.Text };
UserControl1 ctl = new UserControl1(LstIP.Text);
tab.Controls.Add(ctl);
tabControl1.Controls.Add(tab);
//_open[LstIP.SelectedIndex] = true;
}
private void LstIP_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = LstIP.Text;
}
private void button1_Click(object sender, EventArgs e)
{
string[] ip = new string[LstIP.Items.Count];
for (int i = 0; i < ip.Length; i++)
ip[i] = LstIP.Items[i].ToString();
readerAll = new Asa.RFID.HFReaderAll();
readerAll.LogPath = Application.StartupPath;
readerAll.GetValue += Ra_GetValue;
readerAll.Open(ip);
//readerAll.Open("192.168.210.114", "192.168.210.117");
}
private void Ra_GetValue(string s)
{
Invoke(new Action(() =>
{
if (s.Contains(LstIP.Items[0].ToString()))
textBox2.AppendText("======\r\n");
textBox2.AppendText(s + "\r\n");
}));
}
private void Reader_Received(string ip, byte[] buff)
{
try
{
//string val = (char)buff[1] + buff[2].ToString();
//if (ip == currIP) return;
//currIP = ip;
//string s = "";
//if (ip == LstIP.Items[0].ToString())
//{
// s = "========== ";
// sum = 0;
//}
//s += (++sum) + " " + ip + " ";
//s += val;
//info.Enqueue(s);
string s = "";
for (int i = 0; i < buff.Length; i++)
s += buff[i].ToString("X2") + " ";
Invoke(new Action(() => { textBox2.AppendText(s); }));
}
catch (Exception)
{ }
}
private void SaveLog()
{
string _logFile = string.Format("{0}\\RFID_{1:yyyy-MM-dd}.log", Application.StartupPath, DateTime.Now);
while (true)
{
System.Threading.Thread.Sleep(100);
if (info.TryDequeue(out string result))
System.IO.File.AppendAllText(_logFile, string.Format("[{0:HH:mm:ss.fff}] {1}\r\n", DateTime.Now, result), Encoding.UTF8);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RFID_Debug
{
public partial class UserControl1 : UserControl
{
private Asa.RFID.HFReader read;
public UserControl1()
{
InitializeComponent();
}
public UserControl1(string ip) : this()
{
CboType.SelectedIndex = 0;
read = new Asa.RFID.HFReader(ip);
read.Received += Read_Received;
read.Open(false);
if (read.IsConn)
{
read.AutoScanMode(false);
groupBox2.Enabled = true;
groupBox3.Enabled = true;
BtnFind.Enabled = true;
}
else
{
groupBox2.Enabled = false;
groupBox3.Enabled = false;
BtnFind.Enabled = false;
LblID.Text = "无法连接";
}
}
private void Read_Received(string ip, byte[] buff)
{
string s = (char)buff[1] + buff[2].ToString();
this.Invoke(new Action(() => { TxtRead.AppendText(s); }));
}
private void BtnFind_Click(object sender, EventArgs e)
{
bool rtn = read.FindRFID();
if (!rtn)
LblID.Text = "无法连接";
else
LblID.Text = "ID: " + read.ID;
}
private void BtnReadAll_Click(object sender, EventArgs e)
{
byte[] bb = read.Read();
if (bb == null)
{
TxtRead.Text = "";
}
else
{
string s = "";
for (int i = 0; i < bb.Length; i++)
s += bb[i].ToString("X2") + " ";
TxtRead.Text = s;
}
}
private void BtnReadOne_Click(object sender, EventArgs e)
{
byte[] bb = read.Read();
if (bb == null)
{
TxtRead.Text = "";
}
else
{
if (bb[0] == 0x5A && bb[5] == 0x4A)
{
TxtRead.Text = ((char)bb[1]).ToString() + bb[2];
}
else
{
TxtRead.Text = "格式不正确";
}
}
}
private void BtnWrite_Click(object sender, EventArgs e)
{
byte[] bb = new byte[8];
bb[0] = 0x5A;
bb[1] = Convert.ToByte(65 + CboType.SelectedIndex);
bb[2] = Convert.ToByte(NudNumber.Value);
bb[5] = 0x4A;
int sum = 0;
for (int i = 0; i < 6; i++)
sum += bb[i];
byte[] cc = BitConverter.GetBytes(sum);
bb[6] = cc[0];
bb[7] = cc[1];
bool rtn = read.Write(bb);
if (rtn)
label3.Text = ((char)bb[1]).ToString() + bb[2] + " OK";
else
label3.Text = "NG";
}
private void BtnNumMinus_Click(object sender, EventArgs e)
{
if (NudNumber.Value > NudNumber.Minimum)
NudNumber.Value--;
}
private void BtnNumAdd_Click(object sender, EventArgs e)
{
if (NudNumber.Value < NudNumber.Maximum)
NudNumber.Value++;
}
private void BtnClose_Click(object sender, EventArgs e)
{
read.Close();
Parent.Parent.Controls.Remove(Parent);
Parent.Dispose();
Dispose();
}
private void button1_Click(object sender, EventArgs e)
{
read.OpenCloseRF(false);
System.Threading.Thread.Sleep(100);
read.OpenCloseRF(true);
}
}
}
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID</name>
</assembly>
<members>
<member name="T:Asa.RFID.Reader">
<summary>
RFID读卡器
</summary>
</member>
<member name="T:Asa.RFID.Reader.Received_Event">
<summary>
接收事件
</summary>
<param name="ip"></param>
<param name="buff"></param>
</member>
<member name="E:Asa.RFID.Reader.Received">
<summary>
接收数据
</summary>
</member>
<member name="M:Asa.RFID.Reader.#ctor(System.String)">
<summary>
RFID读卡器
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsConn">
<summary>
是否连接
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsAutoScan">
<summary>
是否自动扫描
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsExist">
<summary>
是否存在ID卡
</summary>
</member>
<member name="P:Asa.RFID.Reader.ErrCode">
<summary>
错误代码
</summary>
</member>
<member name="P:Asa.RFID.Reader.IP">
<summary>
IP地址
</summary>
</member>
<member name="P:Asa.RFID.Reader.LogPath">
<summary>
日志目录
</summary>
</member>
<member name="P:Asa.RFID.Reader.ID">
<summary>
ID号码
</summary>
</member>
<member name="M:Asa.RFID.Reader.Open(System.Boolean)">
<summary>
连接
</summary>
<param name="autoScan">自动扫描</param>
</member>
<member name="M:Asa.RFID.Reader.Close">
<summary>
关闭
</summary>
</member>
<member name="M:Asa.RFID.Reader.FindRFID">
<summary>
查找电子标签,扫描模式不能使用
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Read">
<summary>
读取电子标签
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Write(System.Byte[])">
<summary>
写入数据到电子标签,扫描模式不能使用
</summary>
<param name="buff">数据,必须小于等于112字节</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.AutoScanMode(System.Boolean)">
<summary>
自动扫描模式
</summary>
<param name="open"></param>
<param name="open2"></param>
<returns></returns>
</member>
<member name="T:Asa.RFID.ReaderAll">
<summary>
RFID读卡器
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.#ctor">
<summary>
RFID
</summary>
</member>
<member name="P:Asa.RFID.ReaderAll.LogPath">
<summary>
日志目录
</summary>
</member>
<member name="P:Asa.RFID.ReaderAll.ScanMode">
<summary>
扫描模式,true自动,false查找
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.Open(System.String[])">
<summary>
打开所有
</summary>
<param name="ip"></param>
</member>
<member name="M:Asa.RFID.ReaderAll.Close">
<summary>
关闭所有
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.IsOpen">
<summary>
是否打开
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.IsOpen(System.String)">
<summary>
是否打开
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.Read(System.String)">
<summary>
读取
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.ReadStr(System.String)">
<summary>
读取
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.Clear(System.String)">
<summary>
清零
</summary>
<param name="ip"></param>
</member>
<member name="T:Asa.RFID.IP">
<summary>
IP地址操作
</summary>
</member>
<member name="M:Asa.RFID.IP.Find(System.String)">
<summary>
查找IP地址
</summary>
<param name="localIP"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.Modify(System.String,System.String,System.String)">
<summary>
修改IP地址,需要先查找IP
</summary>
<param name="localIP">本地IP</param>
<param name="beforeIP">修改前的IP</param>
<param name="afterIP">修改后的IP</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.GetLocal">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member name="T:Asa.RFID.Log">
<summary>
日志操作类
</summary>
</member>
<member name="M:Asa.RFID.Log.#ctor(System.String)">
<summary>
日志
</summary>
<param name="path">文件夹目录</param>
</member>
<member name="M:Asa.RFID.Log.#ctor(System.String,System.String)">
<summary>
日志
</summary>
<param name="path">文件夹目录</param>
<param name="name">文件名</param>
</member>
<member name="M:Asa.RFID.Log.Exit">
<summary>
退出
</summary>
</member>
<member name="M:Asa.RFID.Log.OutError(System.String)">
<summary>
输出错误信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutInfo(System.String)">
<summary>
输出信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutDebug(System.String)">
<summary>
输出调试信息
</summary>
<param name="s"></param>
</member>
<member name="M:Asa.RFID.Log.OutString(System.String)">
<summary>
输出字符串数据
</summary>
<param name="s"></param>
</member>
</members>
</doc>
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件的差异太大,无法显示。
此文件类型无法预览
此文件的差异被折叠, 点击展开。
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件的差异太大,无法显示。
此文件的差异被折叠, 点击展开。
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!