Skip to content

Commit cc77b4e

Browse files
committed
Добавьте файлы проекта.
1 parent 244a7fe commit cc77b4e

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

GetDesktopPath.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 17
4+
VisualStudioVersion = 17.6.33829.357
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetDesktopPath", "GetDesktopPath\GetDesktopPath.csproj", "{C2C14B30-92F2-4458-9141-25DBB9DB191E}"
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+
{C2C14B30-92F2-4458-9141-25DBB9DB191E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C2C14B30-92F2-4458-9141-25DBB9DB191E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C2C14B30-92F2-4458-9141-25DBB9DB191E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C2C14B30-92F2-4458-9141-25DBB9DB191E}.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 = {9D4525CB-B762-4FC6-B43A-72AB41433F13}
24+
EndGlobalSection
25+
EndGlobal

GetDesktopPath/GetDesktopPath.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0-windows</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<UseWindowsForms>true</UseWindowsForms>
9+
</PropertyGroup>
10+
11+
</Project>

GetDesktopPath/Program.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Console.TreatControlCAsInput = true;
2+
3+
var desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
4+
Console.WriteLine(desktopPath);
5+
6+
Console.ForegroundColor = ConsoleColor.Yellow;
7+
Console.Write("Ctrl + C");
8+
Console.ResetColor();
9+
Console.WriteLine(" for copy to clipboard");
10+
11+
var keyInfo = Console.ReadKey(true);
12+
if(keyInfo.Key is ConsoleKey.C
13+
&& keyInfo.Modifiers is ConsoleModifiers.Control)
14+
{
15+
var t = new Thread(_ => { Clipboard.SetText(desktopPath); Console.WriteLine("Copied to clipboard!"); });
16+
t.SetApartmentState(ApartmentState.STA);
17+
t.Start();
18+
t.Join();
19+
}

0 commit comments

Comments
 (0)