cosmetics and amend spelling error in argument
This commit is contained in:
@@ -6,36 +6,30 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SShot
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
namespace SShot {
|
||||
static class Program {
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
static void Main(string[] args) {
|
||||
string fileName = DateTime.Now.ToString("u").Replace("Z", ".png").Replace(":", "-");
|
||||
string dirName = DateTime.Now.ToString("u").Substring(0, 10);
|
||||
System.IO.Directory.CreateDirectory(dirName);
|
||||
captureScreen(dirName + "\\" + fileName, args);
|
||||
}
|
||||
|
||||
private static void captureScreen(String filename, string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
private static void captureScreen(String filename, string[] args) {
|
||||
try {
|
||||
Rectangle captureRectangle = SystemInformation.VirtualScreen;
|
||||
Bitmap captureBitmap = new Bitmap(captureRectangle.Width, captureRectangle.Height, PixelFormat.Format32bppArgb);
|
||||
Graphics captureGraphics = Graphics.FromImage(captureBitmap);
|
||||
captureGraphics.CopyFromScreen(captureRectangle.Left, captureRectangle.Top, 0, 0, captureRectangle.Size);
|
||||
captureBitmap.Save(filename, ImageFormat.Png);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
catch (Exception ex) {
|
||||
if (args.Length > 0) {
|
||||
if (args[0] != "-QietErrors") {
|
||||
if (args[0] != "-QuietErrors") {
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
8
SShot/Properties/launchSettings.json
Normal file
8
SShot/Properties/launchSettings.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"SShot": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "-QietErrors"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Visual Studio 2019/Visualizers/attribcache140.bin
Normal file
BIN
Visual Studio 2019/Visualizers/attribcache140.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user