Skip to content

Instantly share code, notes, and snippets.

@decriptor
Created December 7, 2019 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save decriptor/32ebe7ecb63b513bd62c0971e93bd7dc to your computer and use it in GitHub Desktop.
Save decriptor/32ebe7ecb63b513bd62c0971e93bd7dc to your computer and use it in GitHub Desktop.
Foo.csproj:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
Program.cs:
using System;
using System.Windows.Forms;
namespace tmp
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Console.WriteLine("Say something and it will be copied to the clipboard");
var something = Console.ReadLine();
Clipboard.SetText(something);
Console.Read();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment