Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fou1100ouacus authored Apr 30, 2024
1 parent b9b6d86 commit b970b70
Show file tree
Hide file tree
Showing 42 changed files with 529 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Permission to Write to Registry/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{35CB579E-949F-4C33-8B74-A574FD7FD103}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Permission_to_Write_to_Registry</RootNamespace>
<AssemblyName>Permission to Write to Registry</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34601.278
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Permission to Write to Registry", "Permission to Write to Registry.csproj", "{35CB579E-949F-4C33-8B74-A574FD7FD103}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35CB579E-949F-4C33-8B74-A574FD7FD103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CB579E-949F-4C33-8B74-A574FD7FD103}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CB579E-949F-4C33-8B74-A574FD7FD103}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CB579E-949F-4C33-8B74-A574FD7FD103}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB6F733C-6F30-4B70-8ED1-33DB7466A7F2}
EndGlobalSection
EndGlobal
33 changes: 33 additions & 0 deletions Permission to Write to Registry/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Permission_to_Write_to_Registry
{
internal class Program
{
static void Main(string[] args)
{// Specify the Registry key and path
string keyPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\YourSoftware";
string valueName = "YourValueName";
string valueData = "YourValueData";


try
{
// Write the value to the Registry
Registry.SetValue(keyPath, valueName, valueData, RegistryValueKind.String);


Console.WriteLine($"Value {valueName} successfully written to the Registry.");
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
}
36 changes: 36 additions & 0 deletions Permission to Write to Registry/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Permission to Write to Registry")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Permission to Write to Registry")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("35cb579e-949f-4c33-8b74-a574fd7fd103")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5bb56c9ef8259863da41b9966ff000324a4ac45ce033dd510671b53b9ecdc07a
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
D:\USED\Permission to Write to Registry\bin\Debug\Permission to Write to Registry.exe.config
D:\USED\Permission to Write to Registry\bin\Debug\Permission to Write to Registry.exe
D:\USED\Permission to Write to Registry\bin\Debug\Permission to Write to Registry.pdb
D:\USED\Permission to Write to Registry\obj\Debug\Permission to Write to Registry.csproj.AssemblyReference.cache
D:\USED\Permission to Write to Registry\obj\Debug\Permission to Write to Registry.csproj.CoreCompileInputs.cache
D:\USED\Permission to Write to Registry\obj\Debug\Permission to Write to Registry.exe
D:\USED\Permission to Write to Registry\obj\Debug\Permission to Write to Registry.pdb
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Reading from Registry/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
41 changes: 41 additions & 0 deletions Reading from Registry/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reading_from_Registry
{
internal class Program
{
static void Main(string[] args)
{
// Specify the Registry key and path
string keyPath = @"HKEY_CURRENT_USER\SOFTWARE\YourSoftware";
string valueName = "YourValueName";


try
{
// Read the value from the Registry
string value = Registry.GetValue(keyPath, valueName, null) as string;


if (value != null)
{
Console.WriteLine($"The value of {valueName} is: {value}");
}
else
{
Console.WriteLine($"Value {valueName} not found in the Registry.");
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}

}
}
}
36 changes: 36 additions & 0 deletions Reading from Registry/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Reading from Registry")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Reading from Registry")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("48eb861c-ce3f-4aac-9d1c-e1ec883133c4")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
53 changes: 53 additions & 0 deletions Reading from Registry/Reading from Registry.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Reading_from_Registry</RootNamespace>
<AssemblyName>Reading from Registry</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions Reading from Registry/Reading from Registry.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34601.278
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reading from Registry", "Reading from Registry.csproj", "{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48EB861C-CE3F-4AAC-9D1C-E1EC883133C4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {93FE9BB5-C582-4A26-8C3E-5BB7E4EB9E7C}
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5bb56c9ef8259863da41b9966ff000324a4ac45ce033dd510671b53b9ecdc07a
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
D:\USED\Reading from Registry\bin\Debug\Reading from Registry.exe.config
D:\USED\Reading from Registry\bin\Debug\Reading from Registry.exe
D:\USED\Reading from Registry\bin\Debug\Reading from Registry.pdb
D:\USED\Reading from Registry\obj\Debug\Reading from Registry.csproj.AssemblyReference.cache
D:\USED\Reading from Registry\obj\Debug\Reading from Registry.csproj.CoreCompileInputs.cache
D:\USED\Reading from Registry\obj\Debug\Reading from Registry.exe
D:\USED\Reading from Registry\obj\Debug\Reading from Registry.pdb
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Writing to Registry/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Loading

0 comments on commit b970b70

Please sign in to comment.