Add option to be silent on errors.
This commit is contained in:
@@ -14,15 +14,15 @@ namespace SShot
|
|||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string fileName = DateTime.Now.ToString("u").Replace("Z", ".png").Replace(":", "-");
|
string fileName = DateTime.Now.ToString("u").Replace("Z", ".png").Replace(":", "-");
|
||||||
string dirName = DateTime.Now.ToString("u").Substring(0, 10);
|
string dirName = DateTime.Now.ToString("u").Substring(0, 10);
|
||||||
System.IO.Directory.CreateDirectory(dirName);
|
System.IO.Directory.CreateDirectory(dirName);
|
||||||
captureScreen(dirName + "\\" + fileName);
|
captureScreen(dirName + "\\" + fileName, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void captureScreen(String filename)
|
private static void captureScreen(String filename, string[] args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -34,9 +34,13 @@ namespace SShot
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
if (args.Length > 0) {
|
||||||
|
if (args[0] != "-QietErrors") {
|
||||||
MessageBox.Show(ex.Message);
|
MessageBox.Show(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user