Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Update 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AHosseinRnj authored Aug 12, 2020
1 parent e0b79b8 commit e750e41
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 40 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<img height="150" width="160" src="https://image.prntscr.com/image/tJMhonbpRZKiok78PX29xw.png"/>
</p>

# SimpleVPN 1.3.0
# SimpleVPN 1.3.1
>SimpleVPN is a PPTP and L2TP Protocol VPN Client written in C# using DOTras.
### Software Pictures
| Not Connected | Connected |
| --- | --- |
|![](https://image.prntscr.com/image/UoXWuGj8QvSuuoTFwZAobA.png) | ![](https://image.prntscr.com/image/iQ7yNdtORiGzL9Cr6ENxQg.png) |
|![](https://i.ibb.co/b7fVfBP/1.png) | ![](https://i.ibb.co/4dy6jNd/2.png) |

## Download
You can download binary from releases:
Expand Down
14 changes: 7 additions & 7 deletions Simple_VPN/Classes/ServerSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ public string ServerIp(string locationName)
switch (locationName)
{
case "France":
IP = "193.70.64.90";
IP = "fr.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.FranceFlg;
break;
case "Canada":
IP = "79.141.166.2";
IP = "ca.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.CanadaFlg;
break;
case "Germany":
IP = "217.20.114.208";
IP = "de.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.GermanyFlg;
break;
case "Argentina":
IP = "190.103.177.28";
IP = "ar.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.ArgentinaFlg;
break;
case "Netherlands":
IP = "185.142.239.83";
IP = "nl.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.NetherlandsFlg;
break;
case "United States":
IP = "147.135.116.81";
IP = "us.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.UsaFlg;
break;
case "Russian Federation":
IP = "45.137.190.23";
IP = "ru.s4m.xyz";
CountriesFlgPicBox.Image = Properties.Resources.RussiaFlg;
break;
default:
Expand Down
44 changes: 42 additions & 2 deletions Simple_VPN/Classes/VPN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,48 @@ class VPN
private string passWord;
private string vpnProtocol;
private string preSharedKey;
public VPN(string serverIP, string adapterName, string userName, string passWord, string vpnProtocol, string preSharedKey)
public VPN(string serverIP = "", string adapterName = "", string userName = "", string passWord = "", string vpnProtocol = "", string preSharedKey = "")
{
setParameters(serverIP, adapterName, userName, passWord, vpnProtocol, preSharedKey);
}

public void setParameters(string serverIP, string adapterName, string userName, string passWord, string vpnProtocol, string preSharedKey)
{
setServerIP(serverIP);
setAdapterName(adapterName);
setUserName(userName);
setPassWord(passWord);
setVPNProtocol(vpnProtocol);
setPreSharedKey(preSharedKey);
}

public void setServerIP(string serverIP)
{
this.serverIP = serverIP;
}

public void setAdapterName(string adapterName)
{
this.adapterName = adapterName;
}

public void setUserName(string userName)
{
this.userName = userName;
}

public void setPassWord(string passWord)
{
this.passWord = passWord;
}

public void setVPNProtocol(string vpnProtocol)
{
this.vpnProtocol = vpnProtocol;
}

public void setPreSharedKey(string preSharedKey)
{
this.preSharedKey = preSharedKey;
}

Expand All @@ -35,7 +70,7 @@ public void Connect()
{
PhoneBook.Entries.Remove(adapterName);
}
if (vpnProtocol.Contains("PPTP"))
if (vpnProtocol.Equals("PPTP"))
{
Entry = RasEntry.CreateVpnEntry(adapterName, serverIP, RasVpnStrategy.PptpOnly, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn));
}
Expand Down Expand Up @@ -95,7 +130,12 @@ public void Disconnect()

public void Dispose()
{
serverIP = null;
adapterName = null;
userName = null;
passWord = null;
vpnProtocol = null;
preSharedKey = null;
dialer = null;
handle = null;
}
Expand Down
2 changes: 1 addition & 1 deletion Simple_VPN/Dashboard.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 11 additions & 14 deletions Simple_VPN/Dashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ public Dashboard()

DashboardDesignClass MainUI;
ServerSelector countryLocation;
Information InfoDialog;
VPN VPN;
Information InfoDialog = new Information();
VPN VPN = new VPN();

private void Form1_Load(object sender, EventArgs e)
{
Administrator_Authentication();
Connection_Authentication();
countryLocation = new ServerSelector();
MainUI = new DashboardDesignClass();
InfoDialog = new Information();
CountriesCmBox.SelectedIndex = 0;
MainUI.DisconnectBtn_Enabled_False();
}
Expand Down Expand Up @@ -57,17 +56,17 @@ private void ConnectBtn_Click(object sender, EventArgs e)
{
if (CountriesCmBox.SelectedItem.Equals("Select"))
{
MessageBox.Show("Please Select a Location", "Error at 0x60", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please Select a Location", "Error at 0x59", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
if (PPTP_rBtn.Checked == false && L2TP_rBtn.Checked == false)
{
MessageBox.Show("Please Select a Protocol", "Error at 0x66", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please Select a Protocol", "Error at 0x65", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
sendCredentials();
VPN.setParameters(serverIP, adapterName, userName, passWord, selectedProtocol, preSharedKey);
try
{
VPN.Connect();
Expand All @@ -89,8 +88,6 @@ private void DisconnectBtn_Click(object sender, EventArgs e)
try
{
VPN.Disconnect();
VPN.Dispose();
VPN = null;
}
finally
{
Expand Down Expand Up @@ -168,20 +165,20 @@ public void ExitMethod()
{
if (ConnectBtn.Enabled == false)
{
MessageBox.Show("Please Disconnect First", "Error at 0x171", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
MessageBox.Show("Please Disconnect First", "Error at 0x168", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
VPN.Dispose();
VPN = null;
MainUI = null;
countryLocation = null;
InfoDialog = null;
GC.Collect();
Application.Exit();
}
}

public void sendCredentials()
{
VPN = new VPN(serverIP, adapterName, userName, passWord, selectedProtocol, preSharedKey);
}

public void Connection_Authentication()
{
while (true)
Expand Down
7 changes: 4 additions & 3 deletions Simple_VPN/Information.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Simple_VPN/Information.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LatestDynLbl.Text" xml:space="preserve">
<value>[+] Fixed Important Bugs
[+] Minor Improvement
[+] More Optimization
[+] SimpleVPN Now Supports "L2TP" Protocol
[+] Free Subscription added for 6 months
[+] Added a new location : Russian Federation</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
6 changes: 3 additions & 3 deletions Simple_VPN/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Simple_VPN")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// 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")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]

0 comments on commit e750e41

Please sign in to comment.