Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit 423db83

Browse files
authored
Add files via upload
0 parents  commit 423db83

46 files changed

Lines changed: 88511 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DVRFaultNET.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.32630.194
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DVRFaultNET", "DVRFaultNET\DVRFaultNET.csproj", "{BB263D63-6A81-464D-9151-F191E8525F21}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{BB263D63-6A81-464D-9151-F191E8525F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BB263D63-6A81-464D-9151-F191E8525F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BB263D63-6A81-464D-9151-F191E8525F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{BB263D63-6A81-464D-9151-F191E8525F21}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {05474256-D804-4687-AB5F-B3BABCBBDEAE}
24+
EndGlobalSection
25+
EndGlobal

DVRFaultNET/App.config

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
5+
</startup>
6+
<system.net>
7+
<settings>
8+
<httpWebRequest useUnsafeHeaderParsing="true"/>
9+
</settings>
10+
</system.net>
11+
<runtime>
12+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
13+
<dependentAssembly>
14+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
15+
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
16+
</dependentAssembly>
17+
</assemblyBinding>
18+
</runtime>
19+
</configuration>

DVRFaultNET/ClientUrl.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Linq;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.IO;
6+
using System.Net;
7+
using System.Text;
8+
9+
namespace DVRFault
10+
{
11+
class ClientUrl
12+
{
13+
public static RespondModel DVRReq(string Address)
14+
{
15+
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($@"{Address}/device.rsp?opt=user&cmd=list");
16+
request.Headers.Add(HttpRequestHeader.Cookie, "uid=admin");
17+
using (Stream stream = request.GetResponse().GetResponseStream())
18+
{
19+
using (StreamReader sr = new StreamReader(stream))
20+
{
21+
RespondModel Respond = JsonConvert.DeserializeObject<RespondModel>(sr.ReadToEnd());
22+
return Respond;
23+
}
24+
}
25+
}
26+
}
27+
}

DVRFaultNET/DVRFault.ico

44.5 KB
Binary file not shown.

DVRFaultNET/DVRFaultNET.csproj

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\ILMerge.3.0.41\build\ILMerge.props" Condition="Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{BB263D63-6A81-464D-9151-F191E8525F21}</ProjectGuid>
9+
<OutputType>Exe</OutputType>
10+
<RootNamespace>DVRFaultNET</RootNamespace>
11+
<AssemblyName>DVRFaultNET</AssemblyName>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<Deterministic>true</Deterministic>
16+
<NuGetPackageImportStamp>
17+
</NuGetPackageImportStamp>
18+
<IsWebBootstrapper>false</IsWebBootstrapper>
19+
<PublishUrl>C:\Users\st0pl\Desktop\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<UseApplicationTrust>false</UseApplicationTrust>
32+
<PublishWizardCompleted>true</PublishWizardCompleted>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
34+
<TargetFrameworkProfile />
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37+
<PlatformTarget>AnyCPU</PlatformTarget>
38+
<DebugSymbols>true</DebugSymbols>
39+
<DebugType>full</DebugType>
40+
<Optimize>false</Optimize>
41+
<OutputPath>bin\Debug\</OutputPath>
42+
<DefineConstants>DEBUG;TRACE</DefineConstants>
43+
<ErrorReport>prompt</ErrorReport>
44+
<WarningLevel>4</WarningLevel>
45+
</PropertyGroup>
46+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
47+
<PlatformTarget>AnyCPU</PlatformTarget>
48+
<DebugType>pdbonly</DebugType>
49+
<Optimize>true</Optimize>
50+
<OutputPath>bin\Release\</OutputPath>
51+
<DefineConstants>TRACE</DefineConstants>
52+
<ErrorReport>prompt</ErrorReport>
53+
<WarningLevel>4</WarningLevel>
54+
</PropertyGroup>
55+
<PropertyGroup />
56+
<PropertyGroup>
57+
<ManifestCertificateThumbprint>B944A4C78EC3441A9D35E3475127F2D5F7DBDB58</ManifestCertificateThumbprint>
58+
</PropertyGroup>
59+
<PropertyGroup>
60+
<ManifestKeyFile>DVRFaultNET_TemporaryKey.pfx</ManifestKeyFile>
61+
</PropertyGroup>
62+
<PropertyGroup>
63+
<GenerateManifests>false</GenerateManifests>
64+
</PropertyGroup>
65+
<PropertyGroup>
66+
<SignManifests>true</SignManifests>
67+
</PropertyGroup>
68+
<PropertyGroup>
69+
<TargetZone>LocalIntranet</TargetZone>
70+
</PropertyGroup>
71+
<PropertyGroup>
72+
<ApplicationIcon>DVRFault.ico</ApplicationIcon>
73+
</PropertyGroup>
74+
<ItemGroup>
75+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
76+
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
77+
</Reference>
78+
<Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
79+
<HintPath>..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
80+
</Reference>
81+
<Reference Include="System" />
82+
<Reference Include="System.Configuration" />
83+
<Reference Include="System.Core" />
84+
<Reference Include="System.Management" />
85+
<Reference Include="System.Web.Extensions" />
86+
<Reference Include="System.Windows.Forms" />
87+
<Reference Include="System.Windows.Forms.DataVisualization" />
88+
<Reference Include="System.Windows.Forms.DataVisualization.Design" />
89+
<Reference Include="System.Xml.Linq" />
90+
<Reference Include="System.Data.DataSetExtensions" />
91+
<Reference Include="Microsoft.CSharp" />
92+
<Reference Include="System.Data" />
93+
<Reference Include="System.Net.Http" />
94+
<Reference Include="System.Xml" />
95+
</ItemGroup>
96+
<ItemGroup>
97+
<Compile Include="ClientUrl.cs" />
98+
<Compile Include="Localization.cs" />
99+
<Compile Include="Program.cs" />
100+
<Compile Include="Properties\AssemblyInfo.cs">
101+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
102+
</Compile>
103+
<Compile Include="RespondModel.cs" />
104+
</ItemGroup>
105+
<ItemGroup>
106+
<None Include="App.config" />
107+
</ItemGroup>
108+
<ItemGroup>
109+
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
110+
<Visible>False</Visible>
111+
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
112+
<Install>true</Install>
113+
</BootstrapperPackage>
114+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
115+
<Visible>False</Visible>
116+
<ProductName>.NET Framework 3.5 SP1</ProductName>
117+
<Install>false</Install>
118+
</BootstrapperPackage>
119+
</ItemGroup>
120+
<ItemGroup>
121+
<Content Include="DVRFault.ico" />
122+
</ItemGroup>
123+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
124+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
125+
<PropertyGroup>
126+
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
127+
</PropertyGroup>
128+
<Error Condition="!Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILMerge.3.0.41\build\ILMerge.props'))" />
129+
</Target>
130+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PublishUrlHistory />
5+
<InstallUrlHistory />
6+
<SupportUrlHistory />
7+
<UpdateUrlHistory />
8+
<BootstrapperUrlHistory />
9+
<ErrorReportUrlHistory />
10+
<FallbackCulture>ru-RU</FallbackCulture>
11+
<VerifyUploadedFiles>false</VerifyUploadedFiles>
12+
</PropertyGroup>
13+
</Project>

DVRFaultNET/Localization.cs

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using Newtonsoft.Json;
8+
9+
namespace DVRFaultNET
10+
{
11+
class Localization
12+
{
13+
private static List<Localization> _defaultLocales =
14+
new List<Localization>
15+
{
16+
new Localization("ru-RU",
17+
new Dictionary<string, string>
18+
{
19+
{ "Input", "Введите URL камеры" },
20+
{ "Uid", "Логин" },
21+
{ "Role", "Роль" },
22+
{ "ResultCode", "Код результата"},
23+
{ "Password", "Пароль" },
24+
{ "ExitDialog", "Нажмите на любую кнопку для выхода или Enter для продолжения." },
25+
{ "ExitMessage", "Выход..."}
26+
27+
}),
28+
new Localization("en-US",
29+
new Dictionary<string, string>
30+
{
31+
{ "Input", "Enter camera URL" },
32+
{ "Uid", "Username" },
33+
{ "Password", "Password" },
34+
{ "Role", "Role" },
35+
{ "ResultCode", "Result code"},
36+
{ "ExitDialog", "Press any button for exit or Enter for continue." },
37+
{ "ExitMessage", "Exiting..."}
38+
39+
})
40+
41+
};
42+
public string LocaleName { get; set; }
43+
public Dictionary<string,string> LocaleValues { get; set; }
44+
public Localization(string LocaleName, Dictionary<string,string> LocaleValues)
45+
{
46+
this.LocaleName = LocaleName;
47+
this.LocaleValues = LocaleValues;
48+
}
49+
public static List<Localization> GetLocale()
50+
{
51+
List<Localization> localization;
52+
if (File.Exists("locale.json"))
53+
{
54+
55+
using (StreamReader streamReader = new StreamReader("locale.json"))
56+
{
57+
string JsonLocale = streamReader.ReadToEnd();
58+
localization = JsonConvert.DeserializeObject<List<Localization>>(JsonLocale);
59+
}
60+
return localization;
61+
}
62+
WriteLocale(_defaultLocales);
63+
return GetLocale();
64+
65+
}
66+
public static string WriteLocale(List<Localization> localization)
67+
{
68+
string JsonLocale;
69+
using (Stream fileStream = new FileStream("locale.json", FileMode.OpenOrCreate))
70+
{
71+
JsonLocale = JsonConvert.SerializeObject(localization);
72+
byte[] buffer = Encoding.UTF8.GetBytes(JsonLocale);
73+
fileStream.Write(buffer, 0, buffer.Length);
74+
}
75+
return JsonLocale;
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)