Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[Simple]Tut how to make VPN GUI [VB 6 + OPENVPN Commands] ]

Status
Not open for further replies.
TS pde po bang pde po bang mg request... kung pde po pakilagay kung anong mga function ang gagamitin ex.(command button,adoconn..etc..) at kung san po ilalagay mga codes... thankx po...
 
sana may mg post n nung code katulad ng pdproxy para ndi n kylangan openvpn files.
 
Nc thread! hahaha XD

pa marka po muna TS! :salute: may pasok pa kce ako ee .. ahaha
 
saan po ung link nung tut about sa:

1.may statistic ng connection
2.recv and sent
3.pinger
4.encypted server.
5. auto update

pa link namn po salamat
 
pa tulong nmn po mga master.. na stuck ako sa error na ito

(I'm trying to parse "ServerA-80.ovpn" as an --option parameter but i dont see a leading '--')

yan yung sabe pag na run ko na yung .exe
 
Public Class Form1
Dim vpn As String
Dim logs As String
'Dim smart As String
'Dim TCP As String


#Region " ClientAreaMove Handling "
Const WM_NCHITTEST As Integer = &H84
Const HTCLIENT As Integer = &H1
Const HTCAPTION As Integer = &H2
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_NCHITTEST
MyBase.WndProc(m)
If m.Result = HTCLIENT Then m.Result = HTCAPTION
'If m.Result.ToInt32 = HTCLIENT Then m.Result = IntPtr.op_Explicit(HTCAPTION) 'Try this in VS.NET 2002/2003 if the latter line of code doesn't do it... thx to Suhas for the tip.
Case Else
'Make sure you pass unhandled messages back to the default message handler.
MyBase.WndProc(m)
End Select
End Sub '#ETO ung CODE para madrag ung borderless form #
#End Region


Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim objStreamWriter As IO.StreamWriter


'Pass the file path and the file name to the StreamWriter constructor.

objStreamWriter = New IO.StreamWriter("\account1.txt")


'Write a line of text.

objStreamWriter.WriteLine(username.Text)


'Write a second line of text.

objStreamWriter.WriteLine(password.Text)


'Close the file.

objStreamWriter.Close()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub logtimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles logtimer.Tick
Dim textline(100000) As String
Dim log_ctr As Integer
Dim last_log As Integer
txtlog.Text = ""
FileOpen(1, Application.StartupPath & "\log.txt", OpenMode.Input, , OpenShare.LockRead)
Do Until EOF(1)
textline(log_ctr) = LineInput(1)
log_ctr = log_ctr + 1
If last_log <> log_ctr Then
For n = last_log To log_ctr - 1
If InStrRev(textline(n), "OpenVPN") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Connecting to Network......." & vbCrLf
ElseIf InStrRev(textline(n), "this configuration to call") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Bypassing Globobo Firewall......" & vbCrLf & "Accessing Server....please wait" & vbCrLf
ElseIf InStrRev(textline(n), "Peer Connection Initiated with 0.0.0.0:0") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Hacking Globobo Server...." & vbCrLf
ElseIf InStrRev(textline(n), "TAP-WIN32 device") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Executing Trojan to Server...." & vbCrLf
ElseIf InStrRev(textline(n), "NETSH: C:\WINDOWS\system32\netsh.exe interface ip set address {") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Warning!! You Have been detected!!" & vbCrLf & "Deleting the content of your Drive C:..." & vbCrLf
ElseIf InStrRev(textline(n), "Successful ARP Flush on interface") > 0 Then
txtlog.SelectedText = txtlog.SelectedText & "Please wait........" & vbCrLf
ElseIf InStrRev(textline(n), "Initialization Sequence Completed") > 0 Then
txtlog.SelectedText = "Just Kidding :p hehe" & vbCrLf & "Initialization Sequence Completed" & vbCrLf
status_lbl.Text = "Connected"
close.Enabled = True
status_lbl.ForeColor = Color.Lime
txtlog.SelectedText = txtlog.SelectedText & "Your Connected, Enjoy Your Browsing" & vbCrLf
ElseIf InStrRev(textline(n), "Inactivity timeout (--ping-restart), restarting") > 0 Then
close.Enabled = True
Dim g As String
g = "taskkill /f /im openvpn.exe"
Shell("cmd /c" & g, vbHide)
g = "taskkill /f /im ping.exe"
Shell("cmd /c" & g, vbHide)
konekbtn.Enabled = True
dkonekbtn.Enabled = False
status_lbl.Text = "Disconnected"
txtlog.Text = "======Inactivity timeout======" & vbNewLine & "Unable to connect..." & vbCrLf & "Please Try to connect again" & vbCrLf & vbCrLf
finger_lbl.Text = "STOP"
finger_lbl.ForeColor = Color.Red
logtimer.Enabled = False
ElseIf InStrRev(textline(n), "Exiting") > 0 Then
close.Enabled = True
Dim g As String
g = "taskkill /f /im openvpn.exe"
Shell("cmd /c" & g, vbHide)
g = "taskkill /f /im ping.exe"
Shell("cmd /c" & g, vbHide)
konekbtn.Enabled = True
dkonekbtn.Enabled = False
status_lbl.Text = "Disconnected"
txtlog.Text = "Unable to connect..." & vbCrLf & "Please Try to connect again" & vbCrLf & vbCrLf
finger_lbl.Text = "STOP"
finger_lbl.ForeColor = Color.Red
logtimer.Enabled = False

End If
Next
last_log = log_ctr
End If
Loop
FileClose(1)
End Sub

Private Sub close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles close.Click
Dim g As String
g = "taskkill /f /im openvpn.exe"
Shell("cmd /c" & g, vbHide)
g = "taskkill /f /im ping.exe"
Shell("cmd /c" & g, vbHide)
FileClose(1)
logtimer.Enabled = False
End

End Sub

Private Sub minimize_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles minimize_btn.Click
Me.WindowState = FormWindowState.Minimized
End Sub

Private Sub konekbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles konekbtn.Click
If ComboBox1.Text = "smart" Then
logs = "\data\log\ServerA-80.log"
'Shell("cmd /c del log.txt", AppWinStyle.Hide)
Shell("cmd /c ping google.com -t", AppWinStyle.Hide)
Shell("cmd ipconfig/flushdns ipconfig/registerdns", AppWinStyle.Hide)
Shell(Application.StartupPath & "\openvpn.exe " & "ServerA - 80.ovpn", AppWinStyle.Hide)
konekbtn.Enabled = False
dkonekbtn.Enabled = True
logtimer.Enabled = True
status_lbl.Text = "Connecting..."
finger_lbl.Text = "Fingering"
finger_lbl.ForeColor = Color.Lime
close.Enabled = False


ElseIf ComboBox1.Text = "globe" Then
logs = "\data\log\ServerA-10201.log"
'Shell("cmd /c del log.txt", AppWinStyle.Hide)
Shell("cmd /c ping google.com -t", AppWinStyle.Hide)
Shell("cmd ipconfig/flushdns ipconfig/registerdns", AppWinStyle.Hide)
Shell(Application.StartupPath & "\openvpn.exe " & "ServerA-10201.ovpn", AppWinStyle.Hide)
konekbtn.Enabled = False
dkonekbtn.Enabled = True
logtimer.Enabled = True
status_lbl.Text = "Connecting..."
finger_lbl.Text = "Fingering"
finger_lbl.ForeColor = Color.Lime
close.Enabled = False


ElseIf ComboBox1.Text = "TCP" Then
logs = "\data\log\ServerA-TCP.log"
'Shell("cmd /c del log.txt", AppWinStyle.Hide)
Shell("cmd /c ping google.com -t", AppWinStyle.Hide)
Shell("cmd ipconfig/flushdns ipconfig/registerdns", AppWinStyle.Hide)
Shell(Application.StartupPath & "\openvpn.exe " & "ServerA-TCP.ovpn", AppWinStyle.Hide)
konekbtn.Enabled = False
dkonekbtn.Enabled = True
logtimer.Enabled = True
status_lbl.Text = "Connecting..."
finger_lbl.Text = "Fingering"
finger_lbl.ForeColor = Color.Lime
close.Enabled = False


End If
End Sub

Private Sub save_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click

Dim objStreamWriter As IO.StreamWriter

'Pass the file path and the file name to the StreamWriter constructor.

objStreamWriter = New IO.StreamWriter("\account2.txt")

'Write a line of text.

objStreamWriter.WriteLine(username.Text)

'Write a second line of text.

objStreamWriter.WriteLine(password.Text)

'Close the file.

objStreamWriter.Close()

End Sub

Private Sub dkonekbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dkonekbtn.Click
Dim g As String
g = "taskkill /f /im openvpn.exe"
Shell("cmd /c" & g, vbHide)
g = "taskkill /f /im ping.exe"
Shell("cmd /c" & g, vbHide)
close.Enabled = True
konekbtn.Enabled = True
dkonekbtn.Enabled = False
FileClose(1)
status_lbl.Text = "Disconnected"
status_lbl.ForeColor = Color.Red
txtlog.Text = ""
finger_lbl.Text = "STOP"
finger_lbl.ForeColor = Color.Red
logtimer.Enabled = False

End Sub

End Class

di ako mka connect.. parang ayaw nya ma open ang vpn application..
 
hindi tlga kokonek yan sir na try ko na yan kung panu maka konek kaso hindi gumana pang VB 2008 po yan..

kahit ung finish product nung gumawa nung code na yan hindi nagana sakin.. may error.. pero na sulusyunan ko na yun... wait post ko code ko

dun lang sa pag coconect at sa log ung problem
 
write the lines for ovpn file :
lines = "client" & vbCrLf & "dev tun" & vbCrLf & "proto " & proto & vbCrLf & "remote " & server(0) & "." & server(1) & "." & server(2) & "." & server(3) & " " & rp & vbCrLf & "keepalive 10 120" & vbCrLf & "resolv-retry infinite" & vbCrLf & "redirect-gateway def1" & vbCrLf & "tun-mtu 1500" & vbCrLf & "tun-mtu-extra 32" & vbCrLf & "comp-lzo" & vbCrLf & "mute 1" & vbCrLf & "mute-replay-warnings" & vbCrLf & "ping-timer-rem" & vbCrLf & "float" & vbCrLf & "lport 53" & vbCrLf & "mssfix 1450" & vbCrLf & "persist-key" & vbCrLf & "persist-tun" & vbCrLf & "ca """ & newAppPath & "\\Appl\\Logs\\Account\\ca.crt""" & vbCrLf & "route-method exe" & vbCrLf & "auth-user-pass """ & newAppPath & "\\Appl\\Logs\\Account\\password.txt""" & vbCrLf & "reneg-sec 0" & vbCrLf & "verb 1" & vbCrLf & "script-security 2 system" & vbCrLf & "log """ & newAppPath & "\\Appl\\Logs\\log.txt"""
TextBox3.Text = lines
System.IO.File.WriteAllText(root & "\threedee.ovpn", TextBox3.Text)

next write the lines into a .bat file :

lines = "cd " & root & "\" & vbCrLf & "set path=""" & Application.StartupPath & "\Appl\app\bin""" & vbCrLf & "openvpn.exe """ & root & "\threedee.ovpn""" & vbCrLf & "pause>null"
System.IO.File.WriteAllText(root & "\kon.bat", lines)

next call the bat file :
Shell("cmd /c del " & Application.StartupPath & "\Appl\Logs\log.txt", AppWinStyle.Hide)
Shell("cmd ipconfig/flushdns ipconfig/registerdns", AppWinStyle.Hide)
Shell("""" & root & "\kon.bat""", AppWinStyle.Hide)
 
Last edited:
salamat po boss Vinceky02.. ok na xa.. kulang nalang ngayun ei yung sa display ng upload & download...
panu kaya yun ::noidea::..?
 
Status
Not open for further replies.
Back
Top Bottom