add projects
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s

This commit is contained in:
admin
2026-03-17 17:25:08 +03:00
parent fc01f07d7c
commit ed55e77e98
39 changed files with 4430 additions and 8 deletions
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+48
View File
@@ -0,0 +1,48 @@
using System.Net;
namespace DahuaIPCRename
{
internal class Program
{
public static Dictionary<string, string> listIPC = new Dictionary<string, string>
{
{"172.22.10.221","Домофон|Глав.вход"},
{"172.22.10.222","Домофон|Линкор"},
{"172.22.10.223","Домофон|НЛК-1"},
{"172.22.10.224","Домофон|НЛК-2"},
{"172.22.10.225","Домофон|Ленмикс"},
{"172.22.10.226","Домофон|Карбон"}
};
static async Task Main(string[] args)
{
foreach (var ipc in listIPC)
{
string baseUrl = $"http://{ipc.Key}";
var credCache = new CredentialCache();
credCache.Add(new Uri(baseUrl), "Digest", new NetworkCredential("admin", "4NUDZhJ7"));
using (var handler = new HttpClientHandler
{
Credentials = credCache,
ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true
})
using (var httpClient = new HttpClient(handler))
{
string requestUrl = $"{baseUrl}/cgi-bin/configManager.cgi?action=setConfig&ChannelTitle[0].Name={ipc.Value}";
var response = await httpClient.GetAsync(requestUrl);
try
{
response.EnsureSuccessStatusCode();
Console.WriteLine($"{ipc.Key}\tOK\t{ipc.Value}");
}
catch (Exception)
{
Console.WriteLine($"{ipc.Key}\tNO\t{ipc.Value}");
return;
}
}
}
Console.ReadKey();
}
}
}