Skip to content

Commit

Permalink
settings form opens with parameter -s or --settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
KTechDev4213 committed Apr 4, 2022
1 parent 3c86356 commit 94cb8a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion QuietCopy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ internal class Program
{
static string[] drives;
private static string destPath;
[STAThread]
static void Main(string[] args)
{
if (args.Length != 0)
{
if (args[0] == "--settings" || args[0] == "-s")
if (args[0].Contains("--settings")|| args[0].Contains("-s"))
{
Application.Run(new SettingsMan());
}
Expand Down Expand Up @@ -77,6 +78,7 @@ private static void copyDrive(string drive)
}
static void copyDir(string dir)
{
//copy all files in directory
foreach (string path in Directory.GetFiles(dir))
{

Expand All @@ -93,6 +95,7 @@ static void copyDir(string dir)
}
}
}
//run copy dire on all subdirs
foreach(string path in Directory.GetDirectories(dir))
{
copyDir(path);
Expand Down
2 changes: 1 addition & 1 deletion QuietCopy/QuietCopy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>inst.html</WebPage>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
15 changes: 11 additions & 4 deletions QuietCopy/SettingsMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,18 @@ private void saveBut_Click(object sender, EventArgs e)

private void destDirBut_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.RootFolder = Environment.SpecialFolder.MyVideos;
if(dialog.ShowDialog() == DialogResult.OK)
try
{
destDirTbox.Text = dialog.SelectedPath;
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.RootFolder = Environment.SpecialFolder.MyVideos;
if (dialog.ShowDialog() == DialogResult.OK)
{
destDirTbox.Text = dialog.SelectedPath;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
Expand Down
Binary file added QuietCopy/publish.zip
Binary file not shown.

0 comments on commit 94cb8a6

Please sign in to comment.