Skip to content

Commit 0dad51b

Browse files
committed
allowing to pass proxy credentials now
1 parent ae6d89b commit 0dad51b

17 files changed

+37
-5
lines changed

App.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3+
<appSettings>
4+
<!-- PROVIDE PROXY CREDENTIALS/ADDRESS HERE! -->
5+
<add key="user" value="[user]"/>
6+
<add key="password" value="[password]"/>
7+
<add key="address" value="http://[proxyaddress]:[port]"/>
8+
<!-- PROVIDE PROXY CREDENTIALS/ADDRESS HERE! -->
9+
</appSettings>
310
<startup>
411
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
512
</startup>

KMB_Image_Sync_Client.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
3939
</Reference>
4040
<Reference Include="System" />
41+
<Reference Include="System.configuration" />
4142
<Reference Include="System.Data" />
4243
<Reference Include="System.Runtime.Serialization" />
4344
<Reference Include="System.ServiceModel" />

MainWindow.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.ComponentModel;
6+
using System.Configuration;
67
using System.IO;
78
using System.Linq;
89
using System.Net;
@@ -90,6 +91,19 @@ private static bool CheckConfiguration()
9091
return false;
9192
}
9293

94+
//check proxy parameters
95+
try
96+
{
97+
var proxy = new WebProxy(ConfigurationManager.AppSettings["address"], true);
98+
proxy.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["user"], ConfigurationManager.AppSettings["password"]);
99+
WebRequest.DefaultWebProxy = proxy;
100+
}
101+
catch (Exception ex)
102+
{
103+
MessageBox.Show("Die Proxy Parameter sind fehlerhaft, bitte prüfe die Angaben in KMB_Image_Sync_Client.exe.config");
104+
return false;
105+
}
106+
93107
if (!Directory.Exists(Configuration.ZielPfad))
94108
{
95109
MessageBox.Show("Der in der Konfiguration eingetragene Zielpfad existiert nicht");

bin/Debug/KMB_Image_Sync_Client.exe

512 Bytes
Binary file not shown.

bin/Debug/KMB_Image_Sync_Client.exe.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3+
<appSettings>
4+
<!-- PROVIDE PROXY CREDENTIALS/ADDRESS HERE! -->
5+
<add key="user" value="[user]"/>
6+
<add key="password" value="[password]"/>
7+
<add key="address" value="http://[proxyaddress]:[port]"/>
8+
<!-- PROVIDE PROXY CREDENTIALS/ADDRESS HERE! -->
9+
</appSettings>
310
<startup>
411
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
512
</startup>

bin/Debug/KMB_Image_Sync_Client.pdb

0 Bytes
Binary file not shown.

obj/Debug/CoreCompileInputs.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
90f82e1b248cdde12190d7501d8ff2c625404d7a
1+
8467ddf28d2ee11c60f2532a438dabaab30d69a3
Binary file not shown.

obj/Debug/KMB_Image_Sync_Client.csproj.FileListAbsolute.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\bin\Debug\KMB_Ima
33
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\bin\Debug\KMB_Image_Sync_Client.pdb
44
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\bin\Debug\Newtonsoft.Json.dll
55
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\bin\Debug\Newtonsoft.Json.xml
6-
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\obj\Debug\KMB_Image_Sync_Client.csprojResolveAssemblyReference.cache
76
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\obj\Debug\MainWindow.g.cs
87
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\obj\Debug\App.g.cs
98
C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\obj\Debug\KMB_Image_Sync_Client_MarkupCompile.cache
Binary file not shown.

obj/Debug/KMB_Image_Sync_Client.exe

512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

obj/Debug/KMB_Image_Sync_Client.pdb

0 Bytes
Binary file not shown.

obj/Debug/KMB_Image_Sync_Client_MarkupCompile.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\App.xaml
1313
11151548125
1414

1515
7-599000568
16-
16-171731029
16+
17-312189793
1717
MainWindow.xaml;
1818

1919
False

obj/Debug/KMB_Image_Sync_Client_MarkupCompile.i.cache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ C:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\App.xaml
1313
11151548125
1414

1515
11455706551
16-
16-171731029
16+
17-312189793
1717
MainWindow.xaml;
1818

19-
False
19+
True
2020

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+

2+
3+
FC:\VS Projects\KMB\KMB_Image_Sync_Client\KMB_Image_Sync_Client\MainWindow.xaml;;
4+

obj/Debug/MainWindow.baml

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)