初始化
This commit is contained in:
22
ConsoleApp1/ConsoleApp1.csproj
Normal file
22
ConsoleApp1/ConsoleApp1.csproj
Normal file
@@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="RabbitMQ.Client" Version="7.2.0" />
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
<ProjectReference Include="..\ViewModels\ViewModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
493
ConsoleApp1/Program.cs
Normal file
493
ConsoleApp1/Program.cs
Normal file
@@ -0,0 +1,493 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using CommonEntity;
|
||||
using RabbitMQ.Client;
|
||||
using RabbitMQ.Client.Events;
|
||||
using RestSharp;
|
||||
using ViewModels;
|
||||
using System.Text.Json;
|
||||
using CommonEntity.RCUEntity;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
|
||||
internal class Program
|
||||
{
|
||||
|
||||
public static async void MQTT()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
//factory.HostName = "122.152.232.170";
|
||||
factory.HostName = "172.16.4.132";
|
||||
factory.UserName = "myuser";
|
||||
factory.Password = "123456";
|
||||
factory.VirtualHost = "/";
|
||||
using (var connection = await factory.CreateConnectionAsync())
|
||||
using (var channel = await connection.CreateChannelAsync())
|
||||
{
|
||||
await channel.QueueDeclareAsync(queue: "mymessage",
|
||||
durable: false,
|
||||
exclusive: false,
|
||||
autoDelete: false,
|
||||
arguments: null);
|
||||
var consumer = new AsyncEventingBasicConsumer(channel);
|
||||
consumer.ReceivedAsync += Consumer_ReceivedAsync; ;
|
||||
await channel.BasicConsumeAsync(queue: "mymessage",
|
||||
autoAck: true,
|
||||
consumer: consumer);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
Console.WriteLine(e1.ToString());
|
||||
}
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
static void MMM()
|
||||
{
|
||||
//心跳
|
||||
//string ASD = "AA 30 00 80 01 00 FF FF FF FF 5F C5 64 B3 93 50 FA 3F 48 D0 E9 C0 DD 7E 7C 62 10 E4 AD 4C EA 0D 04 FD 39 4C A7 77 40 18 7F 31 2D 2D 0D 0A 2D 2D";
|
||||
|
||||
//注册
|
||||
string ASD = "AA 30 00 01 00 01 2F 00 00 00 65 C1 26 0D AB 51 74 F3 F9 BC 33 DF 3A 80 CC 43 71 77 49 84 D5 6F 03 63 76 AF 50 6B 6E 02 AD 94 2D 2D 0D 0A 2D 2D";
|
||||
|
||||
string ASD1 = "AA 16 00 02 00 00 00 00 00 00 F6 D7 30 93 EA 98 2D 2D 0D 0A 2D 2D";
|
||||
|
||||
|
||||
//byte[] key = Tools.HEXString2ByteArray("35 65 6C 6B 48 58 67 76 56 58 4D 4A 6F 68 50 69".Replace(" ", ""));
|
||||
byte[] key = new byte[] { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c };
|
||||
|
||||
var NNN1 = Tools.HEXString2ByteArray(ASD.Replace(" ", ""));
|
||||
string OStr = Tools.ByteToString(NNN1);
|
||||
|
||||
//头
|
||||
byte Header = NNN1[0];
|
||||
|
||||
//从1到3之间的元素,不包括3
|
||||
//长度
|
||||
byte[] Len = NNN1[1..3];
|
||||
|
||||
byte[] Pack_SN = NNN1[3..5];
|
||||
|
||||
//重发次数
|
||||
byte RetryCount = NNN1[5];
|
||||
|
||||
|
||||
//设备编号
|
||||
byte[] DeviceOnlyNo = NNN1[6..10];
|
||||
|
||||
ushort llf = (ushort)NNN1.Length;
|
||||
//IV内容组成:Pack_Head + Pack_LEN + Pack_SN + Retry_Num + Client_ID + Pack_END
|
||||
//2D 2D 0D 0A 2D 2D
|
||||
List<byte> IIV = new List<byte>();
|
||||
IIV.Add(0xAA);
|
||||
IIV.AddRange(BitConverter.GetBytes(llf));
|
||||
IIV.AddRange(Pack_SN);
|
||||
IIV.Add(0x00);
|
||||
IIV.AddRange(DeviceOnlyNo);
|
||||
IIV.AddRange(new byte[] { 0x2D, 0x2D, 0x0D, 0x0A, 0x2D, 0x2D });
|
||||
byte[] New_IV = IIV.ToArray();
|
||||
|
||||
//命令字
|
||||
byte[] Command = NNN1[10..12];
|
||||
|
||||
//AA 30 00 01 00 00 FF FF FF FF C2 B3 1A 5F 98 08 AB 20 48 1A A9 26 B1 30 A2 61 25 EB A3 0B FE 50 C9 B9 F6 97 B5 A9 7C 57 A9 87 2D 2D 0D 0A 2D 2D
|
||||
byte[] GGJ = NNN1[10..^8];
|
||||
|
||||
///加密
|
||||
byte[] oooo = Tools.HEXString2ByteArray("02 00 01 00 1D 05 29 05 20 03 F4 FF 00 00 00 00 24 04 B2 07 6B 00 39 00 1B 00 37 00 01 00".Replace(" ", ""));
|
||||
|
||||
AES_CTR forEncrypting = new AES_CTR(key, New_IV);
|
||||
byte[] encryptedContent = new byte[oooo.Length];
|
||||
forEncrypting.EncryptBytes(encryptedContent, oooo);
|
||||
|
||||
//解密
|
||||
AES_CTR forDecrypting = new AES_CTR(key, New_IV);
|
||||
byte[] decryptedContent = new byte[GGJ.Length];
|
||||
forDecrypting.DecryptBytes(decryptedContent, GGJ);
|
||||
|
||||
|
||||
|
||||
string DStr = Tools.ByteToString(decryptedContent);
|
||||
|
||||
byte[] cmd = decryptedContent[0..2];
|
||||
Console.WriteLine("命令字为A:" + Tools.ByteToString(cmd));
|
||||
|
||||
|
||||
//01
|
||||
//00 00
|
||||
//01 00
|
||||
//01 00
|
||||
//01
|
||||
//00
|
||||
//01
|
||||
//04 0A 4D 00 53 00 0F 80 13 11 0C 80
|
||||
byte 启动原因 = decryptedContent[0];
|
||||
byte[] 设备类型ID = decryptedContent[1..3];
|
||||
byte[] 厂牌ID = decryptedContent[3..5];
|
||||
byte[] 机型ID = decryptedContent[5..7];
|
||||
byte MCU软件版本 = decryptedContent[7];
|
||||
byte MCU硬件版本 = decryptedContent[8];
|
||||
|
||||
byte MCUUUID长度 = decryptedContent[9];
|
||||
byte[] MCUUUID = decryptedContent[10..];
|
||||
}
|
||||
|
||||
public class UserData
|
||||
{
|
||||
public string username { get; set; }
|
||||
public string password { get; set; }
|
||||
}
|
||||
async static void httpsss()
|
||||
{
|
||||
List<UserData> userdata = new List<UserData>();
|
||||
userdata.Add(new UserData { username = "aaa", password = "bbb" });
|
||||
RestClient client1 = new RestClient("http://iot-manage.uts-data.com:5001");
|
||||
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
var request1 = new RestRequest("/api/Values/SetChache", Method.Post);
|
||||
request1.AddJsonBody(userdata);
|
||||
var re = client1.Execute(request1);
|
||||
Console.WriteLine(re);
|
||||
}
|
||||
|
||||
public class MsgData
|
||||
{
|
||||
public string? PhoneNumber { get; set; }
|
||||
public string? CallerName { get; set; }
|
||||
public string? Content { get; set; }
|
||||
public string? StartingPoint { get; set; }
|
||||
public string? DeadLine { get; set; }
|
||||
public string? Type { get; set; }
|
||||
}
|
||||
public static string BaseUrl = "http://blv-rd.tech:19041";
|
||||
public static async Task SendMsg(MsgData data)
|
||||
{
|
||||
var options = new RestClientOptions(BaseUrl);
|
||||
var client = new RestClient(options);
|
||||
|
||||
var request = new RestRequest("/api/CallAndMsg/SendToPhone");
|
||||
request.AddBody(data, ContentType.Json);
|
||||
|
||||
RestResponse response = await client.ExecuteAsync(request, Method.Post);
|
||||
string? allow_or_deny = response.Content;
|
||||
}
|
||||
|
||||
public class DeviceCacheInfo
|
||||
{
|
||||
public int ClientId { get; set; }
|
||||
public string? SecretKey { get; set; }
|
||||
}
|
||||
public static void HttpOOO()
|
||||
{
|
||||
List<DeviceCacheInfo> userdata = new List<DeviceCacheInfo>();
|
||||
userdata.Add(new DeviceCacheInfo { ClientId = 71, SecretKey = "OaPyD3vSC6UCNOBF" });
|
||||
|
||||
RestClient client1 = new RestClient("http://iot-manage.uts-data.com:5001");
|
||||
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
var request1 = new RestRequest("/api/Values/SetDeviceInfoChache", Method.Post);
|
||||
request1.AddJsonBody(userdata);
|
||||
var re = client1.Execute(request1);
|
||||
Console.WriteLine(re);
|
||||
}
|
||||
|
||||
static void MyCRC()
|
||||
{
|
||||
byte[] yu = Tools.HEXString2ByteArray("AA 17 00 00 00 00 47 00 00 00 4B 4F 4F 4F 4E".Replace(" ", ""));
|
||||
ushort hsu000 = Tools.CRC16(yu, yu.Length);
|
||||
}
|
||||
|
||||
async static void UDP_Test()
|
||||
{
|
||||
int clientCount = 20000;
|
||||
var tasks = new Task[clientCount];
|
||||
|
||||
for (int i = 0; i < clientCount; i++)
|
||||
{
|
||||
int clientId = i;
|
||||
tasks[i] = Task.Run(async () =>
|
||||
{
|
||||
using var client = new UdpClient();
|
||||
var serverEP = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 3360);
|
||||
|
||||
// 只发送一次连接消息
|
||||
string msg = $"111";
|
||||
byte[] data = Encoding.UTF8.GetBytes(msg);
|
||||
await client.SendAsync(data, data.Length, serverEP);
|
||||
|
||||
Console.WriteLine($"客户端 {clientId} 已连接");
|
||||
});
|
||||
|
||||
await Task.Delay(1000); // 控制创建速度
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
Console.WriteLine($"所有 {clientCount} 个客户端已创建");
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
static void T1()
|
||||
{
|
||||
var yuanshidata = File.ReadAllText("2.txt", Encoding.UTF8);
|
||||
|
||||
var USA = JsonConvert.DeserializeObject<RCU_UDPData>(yuanshidata);
|
||||
//var USA= JsonSerializer.Deserialize<RCU_UDPData>(yuanshidata);
|
||||
|
||||
var UUA = USA.endpoint;
|
||||
var hostnum = USA.hostnum;
|
||||
var timestamp = USA.currenttimestamp;
|
||||
var data = USA.data;
|
||||
var CCC = Encoding.ASCII.GetString(UUA);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static async Task SSSAAA()
|
||||
{
|
||||
//await Common.Cache.Cache.SetCache();
|
||||
//await Common.Cache.Cache.GetCache();
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
MQTT();
|
||||
Console.ReadLine();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
//int j = 8;
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
//});
|
||||
}
|
||||
int j = 30;
|
||||
Common.Cache.Cache.SetCache("youset", new CommonEntity.CacheEntity.MyData_Cache() { EndPoint = "aaa" + j.ToString() });
|
||||
var USA = Common.Cache.Cache.GetCache("youset");
|
||||
Console.WriteLine(Common.Cache.Cache._sessions.Count);
|
||||
|
||||
byte[] Y111 = Tools.HEXString2ByteArray("AA 1A 00 01 00 00 47 00 00 00 66 62 C8 D9 AE BF 8C 9D".Replace(" ", ""));
|
||||
var AAASSSF = Y111[^5..^3];
|
||||
|
||||
for (int i = 0; i < 100000; i++)
|
||||
{
|
||||
SSSAAA();
|
||||
}
|
||||
|
||||
Console.ReadKey();
|
||||
|
||||
T1();
|
||||
|
||||
UDP_Test();
|
||||
Console.ReadKey();
|
||||
|
||||
MyCRC();
|
||||
//AA150052000247000000525001 CRC data: 62494
|
||||
byte[] Y = Tools.HEXString2ByteArray("AA 1A 00 01 00 00 47 00 00 00 66 62 C8 D9 AE BF 8C 9D".Replace(" ", ""));
|
||||
ushort Y1 = Tools.CRC16(Y, Y.Length);
|
||||
ConcurrentBag<string> sss = new ConcurrentBag<string>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
sss.Add(i.ToString());
|
||||
}
|
||||
|
||||
foreach (var item in sss)
|
||||
{
|
||||
sss.TryTake(out string nnn);
|
||||
}
|
||||
|
||||
ushort sn = 21;
|
||||
byte[] key_key = Encoding.ASCII.GetBytes("OaPyD3vSC6UCNOBF0");
|
||||
|
||||
var yuanshidata = File.ReadAllText("1.txt", Encoding.UTF8);
|
||||
|
||||
byte[] HHHHAAA = Tools.HEXString2ByteArray(yuanshidata.Replace(" ", ""));
|
||||
|
||||
byte[] GGJ1111 = HHHHAAA[10..^8];
|
||||
var jiamishuju = Tools.IHIOT_Message_Content_Encrypt(sn, key_key, GGJ1111);
|
||||
string jiemihoude = Tools.ByteToString(jiamishuju);
|
||||
|
||||
//31 33 31 33 C1 33 30 32 C1 33 DC CC 33 33 32 33 56 31 49 34 72 33 0F 33 2D 33 1F 33 33 33 CC 5C 2D 2D 0D 0A 2D 2D
|
||||
//02 00 02 00 F2 00 03 01 F2 00 EF FF 00 00 01 00 65 02 7A 07 41 00 3C 00 1E 00 2C 00 00 00
|
||||
//var T = System.Text.Json.JsonSerializer.Deserialize<TcpSendDataLog>(AAASSSS1);
|
||||
//var US = T.send_data;
|
||||
//var AAA1232 = US.Select(A => Convert.ToByte(A));
|
||||
|
||||
string[] datannn = "116.5.212.60:34068".Split(':');
|
||||
string ip = datannn[0];
|
||||
ushort port = 0;
|
||||
ushort.TryParse(datannn[1], out port);
|
||||
|
||||
byte[] fff1232 = new byte[] { 0xff, 0x00, 0x00, 0x00 };
|
||||
uint AAASSS = BitConverter.ToUInt32(fff1232);
|
||||
|
||||
byte[] yu = Tools.HEXString2ByteArray("AA 15 00 51 06 01 00 00 00 00 03 00 01".Replace(" ", ""));
|
||||
ushort hsu000 = Tools.CRC16(yu, yu.Length);
|
||||
MsgData ss = new MsgData();
|
||||
ss.PhoneNumber = "15515750973";
|
||||
ss.CallerName = "文祚明";
|
||||
ss.Content = "您的燃气报警器触发警报请尽快确认处理";
|
||||
ss.StartingPoint = Tools.ToUnixTimestampBySeconds(DateTime.Now).ToString();
|
||||
ss.DeadLine = Tools.ToUnixTimestampBySeconds(DateTime.Now.AddMinutes(1)).ToString();
|
||||
ss.Type = "1";
|
||||
SendMsg(ss).Wait();
|
||||
|
||||
|
||||
byte[] bbbuw = Encoding.UTF8.GetBytes("Hello");
|
||||
ushort hsu = Tools.CRC16(bbbuw, bbbuw.Length);
|
||||
//byte[] HHASD= Encoding.ASCII.GetBytes("5elkHXgvVXMJohPi");
|
||||
|
||||
//byte[] DeviceOnlyNo11 = new byte[] { 0x2f,0x00,0x00,0x00};
|
||||
//int JJJ= BitConverter.ToInt32(DeviceOnlyNo11);
|
||||
//httpsss();
|
||||
//byte[] bf = new byte[] { 0xff, 0xff, 0xff, 0xff };
|
||||
//long lla = BitConverter.ToInt32(bf, 0);
|
||||
MMM();
|
||||
|
||||
//Program.MQTT();
|
||||
|
||||
//Console.WriteLine(" 按回车退出");
|
||||
//Console.ReadLine();
|
||||
|
||||
//byte[] qqq1 = Encoding.ASCII.GetBytes("@8xq*BU3+3kuE:Oj");
|
||||
|
||||
//string aaa1 = Tools.ByteToString(qqq1);
|
||||
//byte[] bbb = new byte[] { 0xaa, 0x0c, 0x7a, 0x74, 0x01, 0x01 };
|
||||
|
||||
//bbb.AsSpan<byte>(1, 3);
|
||||
|
||||
//if (bbb is [0b10101010, .. _, 0x01])
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
string NNN3 = Tools.GetMD5("Admin:Pass");
|
||||
|
||||
string HHH = "AA 30 00 36 00 00 FF FF FF FF 22 A5 BB 25 9D A7 EF 4D 21 D5 B1 CA 68 CA 01 3F 7D 2D 75 89 73 19 2F 6C D2 46 68 EE 94 CE FE C1 2D 2D 0D 0A 2D 2D";
|
||||
//解密后36 A8 E4 C0 E6 7D 88 42 13 19 4C BD 60 0F E4 C9 9E 59 68 90 ED C1 92 0A 79 E2 8E 2F
|
||||
byte[] GGJ = Tools.HEXString2ByteArray(HHH.Replace(" ", ""));
|
||||
var AAA = GGJ[1..^3];
|
||||
|
||||
string NNN = Encoding.ASCII.GetString(GGJ);
|
||||
|
||||
byte[] NNN000 = Convert.FromBase64String("qi4ALwMA/////8/vzB8BXXKshD0gekFkJqxc/JpxIfFWtVUFKWECZlbxLS0NCi0t");
|
||||
byte[] NNN1 = Convert.FromBase64String("qjAAGAAA/////6Mx2iQ7s34d9PLhy1rIipFFLahyFKyKssNpYUL5+Kq5LS0NCi0t");
|
||||
var NNN222 = Convert.ToBase64String(NNN1);
|
||||
var NNN444 = Encoding.ASCII.GetBytes(NNN222);
|
||||
|
||||
string NNN555 = Tools.ByteToString(NNN444);
|
||||
|
||||
string NNN33 = Tools.ByteToString(NNN1);
|
||||
|
||||
//AA 13 00 44 0B 00 FF FF FF FF 61 67 EF 6B E8 2D 2D 0D 0A 2D 2D
|
||||
|
||||
Span<byte> slice = NNN1.AsSpan(1, 3);
|
||||
byte Header = NNN1[0];
|
||||
//从1到3之间的元素,不包括3
|
||||
byte[] Len = NNN1[1..3];
|
||||
byte[] Pack_SN = NNN1[3..5];
|
||||
|
||||
byte RetryCount = NNN1[5];
|
||||
byte[] DeviceOnlyNo = NNN1[6..10];
|
||||
byte[] Command = NNN1[10..12];
|
||||
|
||||
|
||||
//校验CRC16,小端模式(低地址在前)
|
||||
//校验内容:Pack_Head + Pack_LEN + Pack_SN + Retry_Num + Client_ID + CMD + PARA
|
||||
byte[] CRCCode = NNN1[^8..^6];
|
||||
|
||||
//// 获取从倒数第三个元素到数组末尾的所有元素
|
||||
byte[] Tail = NNN1[^6..];
|
||||
|
||||
|
||||
string NNN2 = Tools.ByteToString(NNN1);
|
||||
|
||||
string str = "CM:GPIO_WRITE:5:0x19:0x01:1sdfghasada\r\n";
|
||||
byte[] data = Encoding.ASCII.GetBytes(str);
|
||||
// example data
|
||||
//var IV = new byte[] { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff };
|
||||
|
||||
//IV内容组成:Pack_Head + Pack_LEN + Pack_SN + Retry_Num + Client_ID + Pack_END
|
||||
//2D 2D 0D 0A 2D 2D
|
||||
List<byte> IIV = new List<byte>();
|
||||
IIV.Add(0xAA);
|
||||
ushort llf = (ushort)GGJ.Length;
|
||||
IIV.AddRange(BitConverter.GetBytes(llf).Reverse());
|
||||
|
||||
|
||||
|
||||
//加解密
|
||||
byte[] bbb = Tools.HEXString2ByteArray("02 00 01 00 1D 05 29 05 20 03 F4 FF 00 00 00 00 24 04 B2 07 6B 00 39 00 1B 00 37 00 01 00".Replace(" ", ""));
|
||||
byte[] IV = new byte[] { 0xAA, 0x30, 0x00, 0x36, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x2D, 0x2D, 0x0D, 0x0A, 0x2D, 0x2D };
|
||||
byte[] key = new byte[] { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c };
|
||||
|
||||
key = Tools.HEXString2ByteArray("35 65 6C 6B 48 58 67 76 56 58 4D 4A 6F 68 50 69".Replace(" ", ""));
|
||||
IV = Tools.HEXString2ByteArray("AA 30 00 01 00 00 2F 00 00 00 2D 2D 0D 0A 2D 2D".Replace(" ", ""));
|
||||
//Encrypt
|
||||
AES_CTR forEncrypting = new AES_CTR(key, IV);
|
||||
byte[] encryptedContent = new byte[bbb.Length];
|
||||
forEncrypting.EncryptBytes(encryptedContent, bbb);
|
||||
|
||||
// Decrypt
|
||||
AES_CTR forDecrypting = new AES_CTR(key, IV);
|
||||
byte[] decryptedContent = new byte[bbb.Length];
|
||||
|
||||
forDecrypting.DecryptBytes(decryptedContent, bbb);
|
||||
|
||||
string DJIEMI = Tools.ByteToString(decryptedContent);
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
}
|
||||
|
||||
private static Task Consumer_ReceivedAsync(object sender, BasicDeliverEventArgs ea)
|
||||
{
|
||||
var body = ea.Body;
|
||||
var message = Encoding.UTF8.GetString(body.ToArray());
|
||||
Console.WriteLine("收到消息 {0}", message);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public static List<(int start, int end, int density)> GetDensityRankedRanges(
|
||||
List<List<int>> allSelections,
|
||||
int windowSize = 3)
|
||||
{
|
||||
// 初始化数字计数数组
|
||||
int[] counts = new int[101];
|
||||
foreach (var selection in allSelections)
|
||||
{
|
||||
foreach (var num in selection)
|
||||
{
|
||||
if (num >= 1 && num <= 100) counts[num]++;
|
||||
}
|
||||
}
|
||||
|
||||
// 计算所有窗口的密度
|
||||
var densityRanges = new List<(int, int, int)>();
|
||||
for (int start = 1; start <= 100 - windowSize + 1; start++)
|
||||
{
|
||||
int end = start + windowSize - 1;
|
||||
int density = 0;
|
||||
for (int i = start; i <= end; i++)
|
||||
{
|
||||
density += counts[i];
|
||||
}
|
||||
densityRanges.Add((start, end, density));
|
||||
}
|
||||
|
||||
// 按密度排序并返回
|
||||
return densityRanges
|
||||
.OrderByDescending(x => x)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
1
ConsoleApp1/bin/Debug/net8.0/1.txt
Normal file
1
ConsoleApp1/bin/Debug/net8.0/1.txt
Normal file
@@ -0,0 +1 @@
|
||||
AA 30 00 15 00 00 47 00 00 00 31 33 31 33 C1 33 30 32 C1 33 DC CC 33 33 32 33 56 31 49 34 72 33 0F 33 2D 33 1F 33 33 33 CC 5C 2D 2D 0D 0A 2D 2D
|
||||
1
ConsoleApp1/bin/Debug/net8.0/2.txt
Normal file
1
ConsoleApp1/bin/Debug/net8.0/2.txt
Normal file
@@ -0,0 +1 @@
|
||||
{"data":[65,65,53,53,50,48,48,48,53,52,51,51,53,51,52,49,51,52,48,65,56,48,69,66,48,51,54,66,50,52,48,49,48,50,48,48,48,48,48,48,50,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,50,54,48,48,54,68,56,53],"hostnum":[49,48,48,51,95,49,48,55,95,51,54],"endpoint":[49,49,54,46,53,46,50,49,50,46,53,52,58,53,48,50,49,51],"currenttimestamp":1761875911}
|
||||
BIN
ConsoleApp1/bin/Debug/net8.0/CSRedisCore.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/CSRedisCore.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Common.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Common.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Common.pdb
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Common.pdb
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/CommonEntity.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/CommonEntity.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/CommonEntity.pdb
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/CommonEntity.pdb
Normal file
Binary file not shown.
1422
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.deps.json
Normal file
1422
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.exe
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.exe
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.pdb
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.pdb
Normal file
Binary file not shown.
12
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.runtimeconfig.json
Normal file
12
ConsoleApp1/bin/Debug/net8.0/ConsoleApp1.runtimeconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
ConsoleApp1/bin/Debug/net8.0/FASTER.core.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/FASTER.core.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Humanizer.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Humanizer.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/MemoryPack.Core.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/MemoryPack.Core.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/MessagePack.Annotations.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/MessagePack.Annotations.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/MessagePack.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/MessagePack.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Features.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Features.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Hosting.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Hosting.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Logging.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Logging.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.ObjectPool.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.ObjectPool.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Options.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Options.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Primitives.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.Extensions.Primitives.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.NET.StringTools.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Microsoft.NET.StringTools.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Newtonsoft.Json.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Newtonsoft.Json.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Core.Abstractions.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Core.Abstractions.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Core.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Core.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Serialization.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/Orleans.Serialization.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/RabbitMQ.Client.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/RabbitMQ.Client.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/RestSharp.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/RestSharp.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Convention.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Convention.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.TypedParts.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Composition.TypedParts.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Diagnostics.EventLog.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Diagnostics.EventLog.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.IO.Hashing.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.IO.Hashing.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Interactive.Async.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Interactive.Async.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Linq.Async.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Linq.Async.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Memory.Data.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Memory.Data.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Text.Encodings.Web.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Text.Encodings.Web.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Text.Json.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Text.Json.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/System.Threading.RateLimiting.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/System.Threading.RateLimiting.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/ViewModels.dll
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/ViewModels.dll
Normal file
Binary file not shown.
BIN
ConsoleApp1/bin/Debug/net8.0/ViewModels.pdb
Normal file
BIN
ConsoleApp1/bin/Debug/net8.0/ViewModels.pdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user