初始化

This commit is contained in:
2025-11-21 08:48:01 +08:00
commit b4d684a84c
202 changed files with 28585 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.32.1" />
<PackageReference Include="MessagePack" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj" />
<ProjectReference Include="..\CommonTools\CommonTools.csproj" />
<ProjectReference Include="..\guolv\guolv.fsproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>E:\tian\BLS\BLWLogServer\ConsoleApp2\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,655 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: EnergyConsumption.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace BLWData.Entity {
/// <summary>Holder for reflection information generated from EnergyConsumption.proto</summary>
public static partial class EnergyConsumptionReflection {
#region Descriptor
/// <summary>File descriptor for EnergyConsumption.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static EnergyConsumptionReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChdFbmVyZ3lDb25zdW1wdGlvbi5wcm90bxIOQkxXRGF0YS5FbnRpdHki0wEK",
"EUVuZXJneUNvbnN1bXB0aW9uEhEKCUhvdGVsQ29kZRgBIAEoAxISCgpIb3N0",
"TnVtYmVyGAIgASgJEgsKA01hYxgDIAEoCRIQCghFbmRQb2ludBgEIAEoCRIP",
"CgdWZXJzaW9uGAUgASgJEhIKCklzVGFrZUNhcmQYBiABKAgSCQoBVhgHIAEo",
"ARIJCgFBGAggASgBEgkKAVAYCSABKAESDAoES1dfSBgKIAEoARIQCghTdW1f",
"S1dfSBgLIAEoARISCgpDcmVhdGVUaW1lGAwgASgDYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.EnergyConsumption), global::BLWData.Entity.EnergyConsumption.Parser, new[]{ "HotelCode", "HostNumber", "Mac", "EndPoint", "Version", "IsTakeCard", "V", "A", "P", "KWH", "SumKWH", "CreateTime" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// 定义一个Person消息类型
/// </summary>
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class EnergyConsumption : pb::IMessage<EnergyConsumption>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<EnergyConsumption> _parser = new pb::MessageParser<EnergyConsumption>(() => new EnergyConsumption());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<EnergyConsumption> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::BLWData.Entity.EnergyConsumptionReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnergyConsumption() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnergyConsumption(EnergyConsumption other) : this() {
hotelCode_ = other.hotelCode_;
hostNumber_ = other.hostNumber_;
mac_ = other.mac_;
endPoint_ = other.endPoint_;
version_ = other.version_;
isTakeCard_ = other.isTakeCard_;
v_ = other.v_;
a_ = other.a_;
p_ = other.p_;
kWH_ = other.kWH_;
sumKWH_ = other.sumKWH_;
createTime_ = other.createTime_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EnergyConsumption Clone() {
return new EnergyConsumption(this);
}
/// <summary>Field number for the "HotelCode" field.</summary>
public const int HotelCodeFieldNumber = 1;
private long hotelCode_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public long HotelCode {
get { return hotelCode_; }
set {
hotelCode_ = value;
}
}
/// <summary>Field number for the "HostNumber" field.</summary>
public const int HostNumberFieldNumber = 2;
private string hostNumber_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string HostNumber {
get { return hostNumber_; }
set {
hostNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "Mac" field.</summary>
public const int MacFieldNumber = 3;
private string mac_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Mac {
get { return mac_; }
set {
mac_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "EndPoint" field.</summary>
public const int EndPointFieldNumber = 4;
private string endPoint_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string EndPoint {
get { return endPoint_; }
set {
endPoint_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "Version" field.</summary>
public const int VersionFieldNumber = 5;
private string version_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Version {
get { return version_; }
set {
version_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "IsTakeCard" field.</summary>
public const int IsTakeCardFieldNumber = 6;
private bool isTakeCard_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool IsTakeCard {
get { return isTakeCard_; }
set {
isTakeCard_ = value;
}
}
/// <summary>Field number for the "V" field.</summary>
public const int VFieldNumber = 7;
private double v_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double V {
get { return v_; }
set {
v_ = value;
}
}
/// <summary>Field number for the "A" field.</summary>
public const int AFieldNumber = 8;
private double a_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double A {
get { return a_; }
set {
a_ = value;
}
}
/// <summary>Field number for the "P" field.</summary>
public const int PFieldNumber = 9;
private double p_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double P {
get { return p_; }
set {
p_ = value;
}
}
/// <summary>Field number for the "KW_H" field.</summary>
public const int KWHFieldNumber = 10;
private double kWH_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double KWH {
get { return kWH_; }
set {
kWH_ = value;
}
}
/// <summary>Field number for the "Sum_KW_H" field.</summary>
public const int SumKWHFieldNumber = 11;
private double sumKWH_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double SumKWH {
get { return sumKWH_; }
set {
sumKWH_ = value;
}
}
/// <summary>Field number for the "CreateTime" field.</summary>
public const int CreateTimeFieldNumber = 12;
private long createTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public long CreateTime {
get { return createTime_; }
set {
createTime_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as EnergyConsumption);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(EnergyConsumption other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (HotelCode != other.HotelCode) return false;
if (HostNumber != other.HostNumber) return false;
if (Mac != other.Mac) return false;
if (EndPoint != other.EndPoint) return false;
if (Version != other.Version) return false;
if (IsTakeCard != other.IsTakeCard) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(V, other.V)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(A, other.A)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(P, other.P)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(KWH, other.KWH)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(SumKWH, other.SumKWH)) return false;
if (CreateTime != other.CreateTime) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (HotelCode != 0L) hash ^= HotelCode.GetHashCode();
if (HostNumber.Length != 0) hash ^= HostNumber.GetHashCode();
if (Mac.Length != 0) hash ^= Mac.GetHashCode();
if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode();
if (Version.Length != 0) hash ^= Version.GetHashCode();
if (IsTakeCard != false) hash ^= IsTakeCard.GetHashCode();
if (V != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(V);
if (A != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(A);
if (P != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(P);
if (KWH != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(KWH);
if (SumKWH != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SumKWH);
if (CreateTime != 0L) hash ^= CreateTime.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (HotelCode != 0L) {
output.WriteRawTag(8);
output.WriteInt64(HotelCode);
}
if (HostNumber.Length != 0) {
output.WriteRawTag(18);
output.WriteString(HostNumber);
}
if (Mac.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Mac);
}
if (EndPoint.Length != 0) {
output.WriteRawTag(34);
output.WriteString(EndPoint);
}
if (Version.Length != 0) {
output.WriteRawTag(42);
output.WriteString(Version);
}
if (IsTakeCard != false) {
output.WriteRawTag(48);
output.WriteBool(IsTakeCard);
}
if (V != 0D) {
output.WriteRawTag(57);
output.WriteDouble(V);
}
if (A != 0D) {
output.WriteRawTag(65);
output.WriteDouble(A);
}
if (P != 0D) {
output.WriteRawTag(73);
output.WriteDouble(P);
}
if (KWH != 0D) {
output.WriteRawTag(81);
output.WriteDouble(KWH);
}
if (SumKWH != 0D) {
output.WriteRawTag(89);
output.WriteDouble(SumKWH);
}
if (CreateTime != 0L) {
output.WriteRawTag(96);
output.WriteInt64(CreateTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (HotelCode != 0L) {
output.WriteRawTag(8);
output.WriteInt64(HotelCode);
}
if (HostNumber.Length != 0) {
output.WriteRawTag(18);
output.WriteString(HostNumber);
}
if (Mac.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Mac);
}
if (EndPoint.Length != 0) {
output.WriteRawTag(34);
output.WriteString(EndPoint);
}
if (Version.Length != 0) {
output.WriteRawTag(42);
output.WriteString(Version);
}
if (IsTakeCard != false) {
output.WriteRawTag(48);
output.WriteBool(IsTakeCard);
}
if (V != 0D) {
output.WriteRawTag(57);
output.WriteDouble(V);
}
if (A != 0D) {
output.WriteRawTag(65);
output.WriteDouble(A);
}
if (P != 0D) {
output.WriteRawTag(73);
output.WriteDouble(P);
}
if (KWH != 0D) {
output.WriteRawTag(81);
output.WriteDouble(KWH);
}
if (SumKWH != 0D) {
output.WriteRawTag(89);
output.WriteDouble(SumKWH);
}
if (CreateTime != 0L) {
output.WriteRawTag(96);
output.WriteInt64(CreateTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (HotelCode != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(HotelCode);
}
if (HostNumber.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(HostNumber);
}
if (Mac.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Mac);
}
if (EndPoint.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(EndPoint);
}
if (Version.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Version);
}
if (IsTakeCard != false) {
size += 1 + 1;
}
if (V != 0D) {
size += 1 + 8;
}
if (A != 0D) {
size += 1 + 8;
}
if (P != 0D) {
size += 1 + 8;
}
if (KWH != 0D) {
size += 1 + 8;
}
if (SumKWH != 0D) {
size += 1 + 8;
}
if (CreateTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreateTime);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(EnergyConsumption other) {
if (other == null) {
return;
}
if (other.HotelCode != 0L) {
HotelCode = other.HotelCode;
}
if (other.HostNumber.Length != 0) {
HostNumber = other.HostNumber;
}
if (other.Mac.Length != 0) {
Mac = other.Mac;
}
if (other.EndPoint.Length != 0) {
EndPoint = other.EndPoint;
}
if (other.Version.Length != 0) {
Version = other.Version;
}
if (other.IsTakeCard != false) {
IsTakeCard = other.IsTakeCard;
}
if (other.V != 0D) {
V = other.V;
}
if (other.A != 0D) {
A = other.A;
}
if (other.P != 0D) {
P = other.P;
}
if (other.KWH != 0D) {
KWH = other.KWH;
}
if (other.SumKWH != 0D) {
SumKWH = other.SumKWH;
}
if (other.CreateTime != 0L) {
CreateTime = other.CreateTime;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
HotelCode = input.ReadInt64();
break;
}
case 18: {
HostNumber = input.ReadString();
break;
}
case 26: {
Mac = input.ReadString();
break;
}
case 34: {
EndPoint = input.ReadString();
break;
}
case 42: {
Version = input.ReadString();
break;
}
case 48: {
IsTakeCard = input.ReadBool();
break;
}
case 57: {
V = input.ReadDouble();
break;
}
case 65: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
KWH = input.ReadDouble();
break;
}
case 89: {
SumKWH = input.ReadDouble();
break;
}
case 96: {
CreateTime = input.ReadInt64();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
HotelCode = input.ReadInt64();
break;
}
case 18: {
HostNumber = input.ReadString();
break;
}
case 26: {
Mac = input.ReadString();
break;
}
case 34: {
EndPoint = input.ReadString();
break;
}
case 42: {
Version = input.ReadString();
break;
}
case 48: {
IsTakeCard = input.ReadBool();
break;
}
case 57: {
V = input.ReadDouble();
break;
}
case 65: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
KWH = input.ReadDouble();
break;
}
case 89: {
SumKWH = input.ReadDouble();
break;
}
case 96: {
CreateTime = input.ReadInt64();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
package BLWData.Entity;
// 定义一个Person消息类型
message EnergyConsumption {
int64 HotelCode = 1;
string HostNumber = 2;
string Mac = 3;
string EndPoint = 4;
string Version = 5;
bool IsTakeCard = 6;
double V = 7;
double A = 8;
double P = 9;
double KW_H = 10;
double Sum_KW_H = 11;
int64 CreateTime=12;
}

120
ConsoleApp2/Program.cs Normal file
View File

@@ -0,0 +1,120 @@
using System.Net.WebSockets;
using System.Text;
using System.Text.Json;
using BLWData.Entity;
using CommonEntity;
using CommonTools;
using MessagePack;
using Microsoft.FSharp.Collections;
namespace ConsoleApp2
{
internal class Program
{
static void Main(string[] args)
{
string afds = "hello";
string dda = afds;
dda = "world";
Console.WriteLine(afds);
string YYY = File.ReadAllText("3.txt");
NengHao? poo = System.Text.Json.JsonSerializer.Deserialize<NengHao>(YYY);
byte[] qf = MyMessagePacker.FastSerialize(poo);
////宝镜系统使用
//EnergyConsumption ese = new EnergyConsumption();
//ese.HotelCode = poo.HotelCode;
//ese.HostNumber = poo.HostNumber;
//ese.Mac = poo.Mac;
//ese.EndPoint = poo.EndPoint;
//ese.V = poo.V;
//ese.A = poo.A;
//ese.P = poo.P;
//ese.KWH = poo.KW_H;
//ese.SumKWH = poo.Sum_KW_H;
//ese.CreateTime = poo.CreateTime;
//ese.IsTakeCard = poo.IsTakeCard;
//ese.RoomNumber = poo.RoomNumber;
//ese.CarbonVIP = poo.CarbonVIP;
//byte[] data = ese.ToByteArray();
//string TopicKey1 = KafkaKey.BLWLog4BaoJing_RCU_Topic;
//string DetailKey1 = KafkaKey.UDPPackageWholeDataMonitor;
string[] NNN = "34-D0-B8-11-80-80".Split('-');
string n1 = NNN[4];
string n2 = NNN[5];
byte bbn1 = Convert.ToByte(n1, 16);
byte bbn2 = Convert.ToByte(n2, 16);
short MAC1 = Convert.ToInt16(bbn1);
short MAC2 = Convert.ToInt16(bbn2);
string HOSTNUMBER = "099008" + MAC1 + MAC2;
string nnn = File.ReadAllText("1.txt");
UDPPackage? usa = JsonSerializer.Deserialize<UDPPackage>(nnn);
AAA a = new AAA();
MyClass mm = new MyClass();
mm.Age = 30;
mm.FirstName = "Test";
mm.LastName = "我是一从此非常大霏霏 的数据";
a.MyClass = new List<MyClass> { mm };
var asd = System.Text.Json.JsonSerializer.Serialize(a);
var qqfa = Encoding.UTF8.GetBytes(asd.ToString());
//byte[] qf = MyMessagePacker.FastSerialize(mm);
string uuu = MyMessagePacker.FastDeserialize<string>(qf);
AAA uuu111 = MyMessagePacker.FastDeserialize<AAA>(qf);
//Console.WriteLine(uuu.MyClass.FirstOrDefault().FirstName);
FSharpList<byte> b = ListModule.OfArray(new byte[] { 0x01, 0x02, 0x03 });
FSharpList<byte> b1 = ListModule.OfArray(new byte[] { 0x01, 0x02, 0x03 });
bool bf = fv.check(b, b1);
Console.WriteLine(bf);
Console.WriteLine("Hello, World!");
}
public static void google_parse()
{
EnergyConsumption e = new EnergyConsumption();
byte[] bbb = new byte[] { };
e = EnergyConsumption.Parser.ParseFrom(bbb);
}
}
[MessagePackObject]
public class ItsClass
{
[Key(0)]
public string Data { get; set; }
}
[MessagePackObject]
public class MyClass
{
// Key attributes take a serialization index (or string name)
// The values must be unique and versioning has to be considered as well.
// Keys are described in later sections in more detail.
[Key(0)]
public int Age { get; set; }
[Key(1)]
public string FirstName { get; set; }
[Key(2)]
public string LastName { get; set; }
// All fields or properties that should not be serialized must be annotated with [IgnoreMember].
[IgnoreMember]
public string FullName { get { return FirstName + LastName; } }
}
[MessagePackObject()]
public class AAA
{
[Key(0)]
public List<MyClass> MyClass { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net8.0\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>False|2025-08-21T03:00:43.6781283Z||;False|2025-08-21T11:00:12.0221678+08:00||;False|2025-08-21T11:00:02.1990936+08:00||;False|2025-08-21T10:59:34.6009353+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>