Skip to content

Commit 9b6f5ba

Browse files
committed
Added Feature
- Encryption Key is now generated and saved
1 parent 20a06ac commit 9b6f5ba

File tree

12 files changed

+72
-23
lines changed

12 files changed

+72
-23
lines changed

teardrop/.vs/teardrop/v16/.suo

1 KB
Binary file not shown.

teardrop/teardrop/App.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3+
<configSections>
4+
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5+
<section name="teardrop.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6+
</sectionGroup>
7+
</configSections>
38
<startup>
49
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
510
</startup>
@@ -11,4 +16,11 @@
1116
</dependentAssembly>
1217
</assemblyBinding>
1318
</runtime>
19+
<userSettings>
20+
<teardrop.Properties.Settings>
21+
<setting name="key" serializeAs="String">
22+
<value />
23+
</setting>
24+
</teardrop.Properties.Settings>
25+
</userSettings>
1426
</configuration>

teardrop/teardrop/Form1.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ public Form1()
2323

2424
private void Form1_Load(object sender, EventArgs e)
2525
{
26-
Task.Run (() => GetFiles());
26+
if(Properties.Settings.Default.key.Length != 34)
27+
{
28+
Properties.Settings.Default.key = Crypto.GetRandomString(34);
29+
Properties.Settings.Default.Save();
30+
Properties.Settings.Default.Reload();
31+
32+
write("Generated key: " + Properties.Settings.Default.key);
33+
}
34+
else
35+
{
36+
write("Key is: " + Properties.Settings.Default.key);
37+
}
2738

2839

40+
Task.Run(() => GetFiles());
2941
}
3042

3143
public void write(string text)
@@ -86,6 +98,8 @@ public void GetFiles()
8698
write(s);
8799
}
88100
}
101+
102+
write("Done getting files");
89103
}
90104
catch (Exception ex2)
91105
{

teardrop/teardrop/Properties/Settings.Designer.cs

Lines changed: 25 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3-
<Profiles>
4-
<Profile Name="(Default)" />
5-
</Profiles>
6-
<Settings />
7-
</SettingsFile>
2+
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="teardrop.Properties" GeneratedClassName="Settings">
3+
<Profiles />
4+
<Settings>
5+
<Setting Name="key" Type="System.String" Scope="User">
6+
<Value Profile="(Default)" />
7+
</Setting>
8+
</Settings>
9+
</SettingsFile>
512 Bytes
Binary file not shown.

teardrop/teardrop/bin/Debug/teardrop.exe.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3+
<configSections>
4+
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5+
<section name="teardrop.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6+
</sectionGroup>
7+
</configSections>
38
<startup>
49
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
510
</startup>
@@ -11,4 +16,11 @@
1116
</dependentAssembly>
1217
</assemblyBinding>
1318
</runtime>
19+
<userSettings>
20+
<teardrop.Properties.Settings>
21+
<setting name="key" serializeAs="String">
22+
<value />
23+
</setting>
24+
</teardrop.Properties.Settings>
25+
</userSettings>
1426
</configuration>
2 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)