Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
713a5918
Commit
713a5918
authored
Feb 06, 2016
by
justcoding121
Committed by
justcoding121
Feb 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add validation
parent
fcd987bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
SystemProxy.cs
Titanium.Web.Proxy/Helpers/SystemProxy.cs
+37
-16
No files found.
Titanium.Web.Proxy/Helpers/SystemProxy.cs
View file @
713a5918
...
@@ -65,16 +65,26 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -65,16 +65,26 @@ namespace Titanium.Web.Proxy.Helpers
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
,
true
);
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
,
true
);
if
(
reg
!=
null
)
if
(
reg
!=
null
)
{
if
(
reg
.
GetValue
(
"ProxyServer"
)!=
null
)
{
{
var
exisitingContent
=
reg
.
GetValue
(
"ProxyServer"
)
as
string
;
var
exisitingContent
=
reg
.
GetValue
(
"ProxyServer"
)
as
string
;
var
existingSystemProxyValues
=
GetSystemProxyValues
(
exisitingContent
);
var
existingSystemProxyValues
=
GetSystemProxyValues
(
exisitingContent
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
!
x
.
IsSecure
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
!
x
.
IsSecure
);
if
(!(
existingSystemProxyValues
.
Count
()
==
0
))
{
reg
.
SetValue
(
"ProxyEnable"
,
1
);
reg
.
SetValue
(
"ProxyEnable"
,
1
);
reg
.
SetValue
(
"ProxyServer"
,
String
.
Join
(
";"
,
existingSystemProxyValues
.
Select
(
x
=>
x
.
ToString
()).
ToArray
()));
reg
.
SetValue
(
"ProxyServer"
,
String
.
Join
(
";"
,
existingSystemProxyValues
.
Select
(
x
=>
x
.
ToString
()).
ToArray
()));
}
}
else
{
reg
.
SetValue
(
"ProxyEnable"
,
0
);
reg
.
SetValue
(
"ProxyServer"
,
string
.
Empty
);
}
}
}
Refresh
();
Refresh
();
}
}
...
@@ -111,16 +121,27 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -111,16 +121,27 @@ namespace Titanium.Web.Proxy.Helpers
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
var
reg
=
Registry
.
CurrentUser
.
OpenSubKey
(
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
,
true
);
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
,
true
);
if
(
reg
!=
null
)
if
(
reg
!=
null
)
{
if
(
reg
.
GetValue
(
"ProxyServer"
)
!=
null
)
{
{
var
exisitingContent
=
reg
.
GetValue
(
"ProxyServer"
)
as
string
;
var
exisitingContent
=
reg
.
GetValue
(
"ProxyServer"
)
as
string
;
var
existingSystemProxyValues
=
GetSystemProxyValues
(
exisitingContent
);
var
existingSystemProxyValues
=
GetSystemProxyValues
(
exisitingContent
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
x
.
IsSecure
);
existingSystemProxyValues
.
RemoveAll
(
x
=>
x
.
IsSecure
);
if
(!(
existingSystemProxyValues
.
Count
()
==
0
))
{
reg
.
SetValue
(
"ProxyEnable"
,
1
);
reg
.
SetValue
(
"ProxyEnable"
,
1
);
reg
.
SetValue
(
"ProxyServer"
,
String
.
Join
(
";"
,
existingSystemProxyValues
.
Select
(
x
=>
x
.
ToString
()).
ToArray
()));
reg
.
SetValue
(
"ProxyServer"
,
String
.
Join
(
";"
,
existingSystemProxyValues
.
Select
(
x
=>
x
.
ToString
()).
ToArray
()));
}
}
else
{
reg
.
SetValue
(
"ProxyEnable"
,
0
);
reg
.
SetValue
(
"ProxyServer"
,
string
.
Empty
);
}
}
}
Refresh
();
Refresh
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment