change - 修改LogHelper到达可用状态 软件基本完成

master
wangsr 1 year ago
parent 9bb2b81d6e
commit 2c15fa662a

@ -49,7 +49,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="config\log4net.config" />
<None Include="config\log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -32,7 +32,7 @@ namespace HighWayIot.Log4net
*
*/
//private readonly string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config");
private readonly string fileName = "\\config\\log4net.config";
private readonly string fileName = "D:\\Code\\Work\\RFIDAccess\\HighWayIot.Log4net\\config\\log4net.config";
private LogHelper()
{

@ -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", ConfigFileExtension = "config", Watch = true)]

@ -51,9 +51,9 @@ namespace HighWayIot.TouchSocket
};//有客户端断开连接
service.Received = (client, e) =>
{
//从客户端收到信息
var mes = Encoding.ASCII.GetString(e.ByteBlock.Buffer, 0, e.ByteBlock.Len);//注意数据长度是byteBlock.Len
logHelper.Info($"已从{client.IP}:{client.Port}接收到信息:{mes}");
////从客户端收到信息
//var mes = Encoding.ASCII.GetString(e.ByteBlock.Buffer, 0, e.ByteBlock.Len);//注意数据长度是byteBlock.Len
//logHelper.Info($"已从{client.IP}:{client.Port}接收到信息:{mes}");
BufferMemory(BufferAnalysis.SplitByteArray(e.ByteBlock.Buffer, 0, e.ByteBlock.Len));

@ -1,4 +1,5 @@
using System;
using HighWayIot.Log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -8,6 +9,8 @@ namespace RFIDSocket
{
internal static class Program
{
private static LogHelper logger = LogHelper.Instance;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
@ -16,6 +19,7 @@ namespace RFIDSocket
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
logger.Info("初始化启动");
Application.Run(new RFIDSocket());
}
}

@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -104,6 +104,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HighWayIot.Log4net\HighWayIot.Log4net.csproj">
<Project>{DEABC30C-EC6F-472E-BD67-D65702FDAF74}</Project>
<Name>HighWayIot.Log4net</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Repository\HighWayIot.Repository.csproj">
<Project>{d0dc3cfb-6748-4d5e-b56a-76fdc72ab4b3}</Project>
<Name>HighWayIot.Repository</Name>

Loading…
Cancel
Save