初始化

This commit is contained in:
2025-11-20 15:56:30 +08:00
commit ab6e620f8e
154 changed files with 29677 additions and 0 deletions

View 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="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="RabbitMQ.Client" Version="7.1.2" />
<PackageReference Include="RestSharp" Version="112.1.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>C:\Program Files\IIS\Microsoft Web Deploy V3\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

64
ConsoleApp2/Program.cs Normal file
View File

@@ -0,0 +1,64 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualBasic;
using Newtonsoft.Json;
using RestSharp;
namespace ConsoleApp2
{
internal class Program
{
public static System.Timers.Timer timer;
static void Main(string[] args)
{
//ServiceCollection services = new ServiceCollection();
//string ss0 = File.ReadAllText("1.txt");
//string ss1 = File.ReadAllText("2.txt");
//string n = ss0 + ss1;
//Console.WriteLine(n);
timer = new System.Timers.Timer();
timer.Interval = 60000;
//timer.Interval = 3;
timer.Elapsed += Timer_Elapsed;
timer.Start();
Console.ReadLine();
}
async private static void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
try
{
Console.WriteLine("发送了请求");
await Send_Http_Request_Params(BaseUrl, "/Index.aspx", Method.Get);
await Send_Http_Request_Params(BaseUrl1, "/api/Values/HeartCallWake", Method.Post);
//电话机
await Send_Http_Request_Params(BaseUrl2, "/Home/Halo", Method.Post);
}
catch (Exception)
{
Console.WriteLine("出错了");
}
}
//千里马模拟器
static public string BaseUrl = "http://localhost:19056";
//这台电脑上安装不了.net frameworkd所有不能使用
//现在 安装在47.119电脑上
//static public string BaseUrl1 = "http://pms.boonlive-rcu.com:19055";
//日志服务器
static public string BaseUrl1 = "http://localhost:19055";
static public string BaseUrl2 = "http://blv-rd.tech:19041";
public static async Task<string> Send_Http_Request_Params(string BaseUrlstr, string Url, Method M)
{
var client1 = new RestClient(BaseUrlstr);
var request1 = new RestRequest(Url, M);
var response = await client1.ExecuteAsync(request1);
var content = response.Content;
return content;
}
}
}