This commit is contained in:
2023-05-28 06:41:22 +03:00
parent 1137495368
commit 80b2df1121
3 changed files with 48 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
<StartupObject>NetWork.Program</StartupObject>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Nullable>enable</Nullable>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<StartWorkingDirectory>.</StartWorkingDirectory>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
@@ -43,6 +43,8 @@
<ItemGroup>
<PackageReference Include="AudioControl.x64" Version="1.0.1" />
<PackageReference Include="AutoHotkey.Interop" Version="1.0.0.1" />
<PackageReference Include="LiteDB" Version="5.0.16" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.5" />
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.Windows.ApiSets-x64" Version="1.0.0" />
<PackageReference Include="NAudio" Version="2.0.1" />
@@ -58,6 +60,7 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SimpleWifi.netstandard" Version="2.0.0" />
<PackageReference Include="SQLite" Version="3.13.0" />
<PackageReference Include="System.Management" Version="6.0.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
<PackageReference Include="TaskScheduler" Version="2.10.1" />

View File

@@ -445,8 +445,8 @@ namespace NetWork
task.FindTask("StartUp and Run").Run();
}
public static bool IniData() {
return Registry.CurrentUser.GetValue("Software\\SaretNetwork\\Run") is null? true: false;
//return System.IO.File.ReadAllText("Other\\Data.ini").Equals("RunNetwork");
var toRunOrNotToRun = Registry.GetValue(@"HKEY_CURRENT_USER\Software\SaretNetwork", "Run", 1);
return toRunOrNotToRun is null? true: toRunOrNotToRun.Equals(1)?true:false;
}
static void Main(string[] args) {
Log.Logger = new LoggerConfiguration().WriteTo.File("Logs/NetworkLog.log", LogEventLevel.Debug,

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using Microsoft.Win32;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace NetWork
{
internal class RegistarRegistry
{
public static bool IniData()
{
var toRunOrNotToRun = Registry.GetValue(@"HKEY_CURRENT_USER\Software\SaretNetwork", "Run", 1);
return toRunOrNotToRun is null ? true : toRunOrNotToRun.Equals(1) ? true : false;
}
}
internal class NetworkInterface
{
//public
}
internal class ListOfPrograms
{
public string[] ProgramName { get; private set; }
public string[] ProgramPath { get; private set; }
public ListOfPrograms(string url) {
WebClient webClient = new();
string[] data = Regex.Split(Regex.Replace(webClient.DownloadString(url),@"[\{\}]",""),",");
//ProgramName = new string[data.Length];
//ProgramPath = new string[data.Length];
//for(int i = 0; i < data.Length; i++)
//{
// ProgramName[i] = Regex.
//}
string d = Regex.Replace(webClient.DownloadString(url), @"[\{\}]", "");
ProgramName = Regex.Matches(d,@"(?<=\"")\w+(?=\"":)").Select(x => x.Value).ToArray();
}
}
}