Created
March 30, 2012 06:47
-
-
Save hwada/2247937 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CaptureSaver | |
{ | |
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
if(args.Length == 0) { return; } | |
var img = Clipboard.GetImage(); | |
if(img == null) { return; } | |
var dir = args[0]; | |
if(!Directory.Exists(dir)) { return; } | |
try | |
{ | |
var file = Enumerable.Range(1, 9999) | |
.Select(n => Path.Combine(dir, string.Format("Capture_{0}.png", n))) | |
.First(s => !File.Exists(s)); | |
img.Save(file); | |
} | |
catch | |
{ | |
// (´・ω・`) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment