From 4b1244635e3690c139be9278b4c8beb6971acba8 Mon Sep 17 00:00:00 2001 From: Bitl Date: Fri, 8 Nov 2019 16:53:04 -0700 Subject: [PATCH] test file downloader app for downloading files using a WIP downloader class. --- NovetusLauncher/.vs/NovetusLauncher/v14/.suo | Bin 159232 -> 133120 bytes .../.vs/NovetusTest_FileDownloader/v14/.suo | Bin 0 -> 34816 bytes .../NovetusTest_FileDownloader.sln | 22 +++ .../NovetusTest_FileDownloader/App.config | 6 + .../NovetusTest_FileDownloader/Downloader.cs | 80 ++++++++++ .../Form1.Designer.cs | 140 ++++++++++++++++++ .../NovetusTest_FileDownloader/Form1.cs | 38 +++++ .../NovetusTest_FileDownloader/Form1.resx | 120 +++++++++++++++ .../NovetusTest_FileDownloader.csproj | 91 ++++++++++++ .../NovetusTest_FileDownloader/Program.cs | 22 +++ .../Properties/AssemblyInfo.cs | 36 +++++ .../Properties/Resources.Designer.cs | 71 +++++++++ .../Properties/Resources.resx | 117 +++++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++ .../Properties/Settings.settings | 7 + 15 files changed, 780 insertions(+) create mode 100644 NovetusTest_FileDownloader/.vs/NovetusTest_FileDownloader/v14/.suo create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader.sln create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/App.config create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Downloader.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.Designer.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.resx create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/NovetusTest_FileDownloader.csproj create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Program.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/AssemblyInfo.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.Designer.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.resx create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.Designer.cs create mode 100644 NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.settings diff --git a/NovetusLauncher/.vs/NovetusLauncher/v14/.suo b/NovetusLauncher/.vs/NovetusLauncher/v14/.suo index 30276c7916151c9c43f6e1f9a342f12e869d9995..70447da30bb3f7bc82586c5eb70300a45f020b04 100644 GIT binary patch delta 3188 zcmcgudr*|u75~oJ4_x3w7ce{wh0O*Kjgnm+f~n=TE44@}p^UN34uf$;WsrxgrbCrQ zO(!kc5!`FICLsntbZa`AiF_?L`bTSGlSvyo+SK-+I7DYm+kec^mPC_L=()?Ttm$JW zGi@*YzI*QDoO^%goO|!~U5)D-G!L%HSfMD2i7+!eJ4=-Ugog=smK3+;Z09-%U|U>s ze3pA)=nwF9wma50I*pL{DNX5pfId{>8K`N#M3NpO6cQYSVuFQ0c4rf)jv?d`77*eH z4-x)GkmIuCkQ^Is2dT~?2IDPmdrLeiJx5&G%WmhOn? zNcvKarms?;bdT(p^rd^E>C+lbvl0H1tE3p=FO_5={vrBvt+{W6{$d)7Y*LOy)7NP1 zKKd!3YdEG&Bb#1wnf+?fnn1pjIZY13o9~CQOfNtM+nsjCuq~d1K$c6B3rptGFgu)@ zV|cUt5Xf6+cHY;S7p45Xo{aiN9J3-CnEnd@z&DZ`&jXx1&8M8ZSip+lC`E=|Tz#&>>wn;-N7xd1H_Yyu3FyEN(df~Z-{TfRZEV$tU zi#;Vo?a7!e0u0sx>SY*Mr!uw0o<9(_GD!7dLbS(Up!N`9l)&6A>EB&Kf?QIT6C~?| zBZQw2P7<;SKP8+Zyhh-J6vCXw?Ck3#pN(o8Vfkn5w=D-*eW|L--Lg&FGGUT+ZA)YR zZDo|;rGKYhYk2NwRNo?e9&XU2}c6}xUjhVi*)0R-KY7;B<^GySB+ury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#fzS$_J| zR$4*y!Hs2iak`bl;#BYON>x9N*?PU8x4gNCg2NyZ*3$D`8!4ak z&vz3uwb_y9Zd{kVx!A7Ri*tzEl5C>8kaFf`f)*JdRT_vg4J45ynvN#}S}N$4;USwH z`g9N}!9y=e!+eaL245zgd}Yq}#0u9PKc#LGj(aGPS0_15j?y81#VEqOo~rbwV>FvY z{_p9aXnuso(PuLKe-XcXnG7DTy>$Kn4#P0A>5^1EvxA;^$xLY;WIcypNJDr z(t1((G~F5UL%MrXq=Mu(&RLTC0=^9+(yY3*pUzjB5?kqy z?g324u!(l-*o6n^|8$5xB|%m6j^zC+HhMvBk zj)mOV8G)UNbu)%bw~>lO$x*srq+P|mHsf77@*^9@PcNmi%4 z_0s5MT%?lq=|CDZ$@(0!NIeTc$YkoW5W|0756#sd??o_nYm zpAnXFrBo?U9#bAt%5nTlm15;#^nFE)B5i^hMw!jfA z?z-f4)EtV2!?fu&HWcvNw<85e&?ydli#N_6L^-iHc}IPO*!wN{>lN22j!`H7s%E1I zEg{)?#P>~W+9P56>z4+p#ZRagX$@Z!Z4DUu2;Yo0D|r1RBhSwng)l!smuWqZe15E6 aYhWhEPc2={lUXRY=U8-$%J6#idj1UyBABrN diff --git a/NovetusTest_FileDownloader/.vs/NovetusTest_FileDownloader/v14/.suo b/NovetusTest_FileDownloader/.vs/NovetusTest_FileDownloader/v14/.suo new file mode 100644 index 0000000000000000000000000000000000000000..40a57c2085a19195635f5331afb9f57cbd5645f3 GIT binary patch literal 34816 zcmeHPYm8gP6~5jikc2>+Qo^GY90-uY+IZJquQxBUw%41KJeKT(v~k#Y?Q6$buf4Us zc~iohQXsscrL;|vSnV(+uXT{{UC`*)2&#h1{FnqTeo|Vrk%H?=( z0epJy+&Km@9FL2xiE3bvlEE*p*p(h74L_?KV^dmoYm{Y^ZN8#Ls;#H4eB|`=@7wH% zcj`+bavv~eltapPV2|UeM>#42EdH+n2O6u}O0pj!64+OB5hUUh>y#GTjR=%ws1(omeFI)zV#k5ot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y*fl!Y~nSU2*-WDc@9Wl=jY@K%f%zGd*nbx9l6Bw}sA zm8c!71X?<#kcMkcN_@;SiV#}CGZ#vQ%(FNyrE%(0RD2h+tkeu};51Urv4A>cxuP#u3(YJER$8@kSEjfg%rVQ=#Qa_jaL1>(PAab;%GJ*N zS^08@rMM=W7hdHLXCgfV8;P(f5uw#ALST35$rjjECg9eY&#h(RhhR)7NN3_G+*5&r7E??LF z)_uZ4q7SACk%YQ4lE(j-n$9~1w>t-OYF64WwAw32EEJ?3%L;efNZjq~@J3>8uSa!v z?BCDr_ns)0yO#c5y;H8bway|od9CUXQWi>Z8Tqzqj3 z?gdO$TQLOLH4Lpn8hQ!dK}xr49=rCG`tt4#;h;2Hw zx?-F(Q$%dkvvNm_nprV+P9OhKW1K?1ao{QRR{1`ioL(N2_{ut*DVj=W9w4jYq-;?o zO4T6F{|^B~e-gGM#tWQg^9Jgw1+5S`Rr!T>Q3Se1@`9W*rTe>jfRutByaq4gYH95H zs&{OOroFR^#(Ty~$7!L=#v?4=MP|HLtojXPg-~OfS-p!)>{cz_KUVH;w8i_!s@;XQ z5}keO_mAC+TD~i1UE|Ua0ra&6~T{3fJ@1ar@r9p}wJO2T!%kt4kMS+HHAiwvP6v=t#Md zF1dBV4gyP+;36;R_b!S%7d0-Lje8g84qa!yFt)jUo|B@B6#lPJY*_rRo&50eFK@*&&n(WL+dCVYQ7#TnUK5LP=+KN_ zr8!rqta6U4)9tIkIlQq%xNF|>;~@$NF4*yRxx9mQcCKEX9V}M4#NE-}QGrXi^(x%D zw>Z|&{$T!$FAd3T3*~lTi<47X<`I{*7MMrpq3QSL`u<<)|NnSiXzv@jZ-OUf3##1m OXL!XW&%d7`8vhSE#_$FJ literal 0 HcmV?d00001 diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader.sln b/NovetusTest_FileDownloader/NovetusTest_FileDownloader.sln new file mode 100644 index 0000000..90ad2b6 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NovetusTest_FileDownloader", "NovetusTest_FileDownloader\NovetusTest_FileDownloader.csproj", "{8638EB3E-97F1-4468-ADC1-DCFCB2902BBB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8638EB3E-97F1-4468-ADC1-DCFCB2902BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8638EB3E-97F1-4468-ADC1-DCFCB2902BBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8638EB3E-97F1-4468-ADC1-DCFCB2902BBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8638EB3E-97F1-4468-ADC1-DCFCB2902BBB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/App.config b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Downloader.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Downloader.cs new file mode 100644 index 0000000..08c397e --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Downloader.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Net; +using System.Windows.Forms; +using System.IO; +using System.ComponentModel; + +class Downloader +{ + private string fileURL; + private string fileName; + private string fullFileName; + private string fileEXT; + private string fileFilter; + private string downloadOutcome; + private string downloadOutcomeAddText; + private ProgressBar downloadProgress; + private SaveFileDialog saveFileDialog1; + + public Downloader(string url, string name, string ext, string filter, ProgressBar progress) + { + fileName = name; + fileEXT = ext; + fileURL = url; + fileFilter = filter; + fullFileName = fileName + fileEXT; + downloadProgress = progress; + } + + public void setDownloadOutcome(string text) + { + downloadOutcome = text; + } + + public string getDownloadOutcome() + { + return downloadOutcome; + } + + public void InitDownload(string additionalText = "") + { + downloadOutcomeAddText = additionalText; + + saveFileDialog1 = new SaveFileDialog() + { + FileName = fullFileName, + //"Compressed zip files (*.zip)|*.zip|All files (*.*)|*.*" + Filter = fileFilter, + Title = "Save " + fullFileName + }; + + if (saveFileDialog1.ShowDialog() == DialogResult.OK) + { + try + { + MessageBox.Show(saveFileDialog1.FileName); + + using (WebClient wc = new WebClient()) + { + wc.DownloadProgressChanged += wc_DownloadProgressChanged; + wc.DownloadFileAsync(new Uri(fileURL), saveFileDialog1.FileName); + } + + downloadOutcome = "File " + fullFileName + " downloaded!" + downloadOutcomeAddText; + } + catch (Exception ex) + { + downloadOutcome = "Error when downloading file: " + ex.Message; + } + } + } + + void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) + { + downloadProgress.Value = e.ProgressPercentage; + } +} diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.Designer.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.Designer.cs new file mode 100644 index 0000000..30ca180 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.Designer.cs @@ -0,0 +1,140 @@ +namespace NovetusTest_FileDownloader +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(36, 101); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(365, 23); + this.button1.TabIndex = 0; + this.button1.Text = "download"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(36, 72); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(365, 23); + this.progressBar1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(59, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(46, 13); + this.label1.TabIndex = 2; + this.label1.Text = "filename"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(36, 36); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 3; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(162, 36); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.TabIndex = 4; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(201, 13); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(18, 13); + this.label2.TabIndex = 5; + this.label2.Text = "url"; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(301, 36); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(100, 20); + this.textBox3.TabIndex = 6; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(328, 13); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(40, 13); + this.label3.TabIndex = 7; + this.label3.Text = "file ext."; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(439, 139); + this.Controls.Add(this.label3); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.label2); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label1); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.Name = "Form1"; + this.Text = "Test File Downloader"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label3; + } +} + diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.cs new file mode 100644 index 0000000..0bdae76 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace NovetusTest_FileDownloader +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + Downloader download = new Downloader(textBox2.Text, textBox1.Text, textBox3.Text, "All files (*.*)|*.*", progressBar1); + + try + { + download.InitDownload(" This was a test download."); + } + catch (Exception) + { + } + + if (!string.IsNullOrWhiteSpace(download.getDownloadOutcome())) + { + MessageBox.Show(download.getDownloadOutcome()); + } + } + } +} diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.resx b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/NovetusTest_FileDownloader.csproj b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/NovetusTest_FileDownloader.csproj new file mode 100644 index 0000000..26496f2 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/NovetusTest_FileDownloader.csproj @@ -0,0 +1,91 @@ + + + + + Debug + AnyCPU + {8638EB3E-97F1-4468-ADC1-DCFCB2902BBB} + WinExe + Properties + NovetusTest_FileDownloader + NovetusTest_FileDownloader + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Program.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Program.cs new file mode 100644 index 0000000..2d7fd53 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace NovetusTest_FileDownloader +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/AssemblyInfo.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3911c44 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NovetusTest_FileDownloader")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NovetusTest_FileDownloader")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8638eb3e-97f1-4468-adc1-dcfcb2902bbb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.Designer.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.Designer.cs new file mode 100644 index 0000000..9238352 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NovetusTest_FileDownloader.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NovetusTest_FileDownloader.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.resx b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.Designer.cs b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6b32b0c --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NovetusTest_FileDownloader.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.settings b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/NovetusTest_FileDownloader/NovetusTest_FileDownloader/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +