|
using System;
using System.Windows.Forms;
namespace CopyFileGeneric
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(params string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length == 0)
{
Application.Run(new Form2());
}
else if (args.Length == 1)
{
MainWindow main = new MainWindow();
try
{
main.SetDestination(args[0]);
main.SetSource(Clipboard.GetFileDropList());
main.StartCopy();
Application.Run(main);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Error");
}
}
else
{
usage();
}
}
private static void usage()
{
System.Text.StringBuilder msg = new System.Text.StringBuilder();
msg.AppendLine("CopyFileGeneric.exe [Destination]");
msg.AppendLine("Destination: Copyies files listed on clipboard to the Destination");
MessageBox.Show(msg.ToString(), "Usage", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.