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!

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

shadow046

Symbianize Chieftain
Advanced Member
Messages
1,378
Reaction score
0
Points
26
http://www.youtube.com/watch?v=WcrQJ4UMYqM <---eto na yung video tutorial ^_^ pag pasensyahan nyo na hindi ako sanay gumawa eh:yipee:


Part 1
First nating gagawin sympre iopen ang VB6 hehehe wala kang VB6? eto o portable... VB6 portable
then pag open na... maglagay tayo ng dalawang textbox at isang command button
para saan ang dalawang textbox at command button?
eto dapat ang nakalagay sa mga properties nila

textbox1 (Name) = username <---- para sa username natin
textbox2 (Name) = password<---- para sa password natin
command button (Name) = save (caption) = save <--- para sa save button natin

kapag nalagay na natin lahat yan sa kanya kanya nilang properties double click natin yung save button
para malagyan na natin ng code....

Private Sub save_Click()
Open App.Path & ("\data" + "/" + Account + "Account.txt") For Output As #1
Print #1, username.text
Print #1, password.text
Close #1
MsgBox "Saved", vbQuestion, "S-vpn"

End Sub

View attachment 46443


ayan tapos na yata tayo sa account ^_^ pasensya na kung medyo magulo or hindi nyo maintindihan...

Part 2 para sa logs at connect naman tayo :)

gawa ulit tayo ng isang Timer, isang textbox at isang command button ulit ^_^ yung timer ilagay nyo na lang sa isang gilid kasi hindi naman makikita yan...
para saan ito?

Timer (Name) = log_Timer (Enabled) = False (Interval) = 250 <---- yan ang magbabasa ng status ng openvpn natin at mag rerefresh sa textbox3 natin
textbox3 (Name) = logs <---- para sa logs yan
command button (Name) = connect (capton) = Connect <---- para naman sa connect buttong natin

kapag nalagay na ulit natin lahat yan sa kanya kanya nilang properties double click naman po natin yung connect button
para malagyan ulit natin ng code

Private Sub connect_Click()
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End Sub

pagkatapos na kayo sa connect button eto naman po para sa timer natin

Private Sub log_Timer_Timer()
Dim line(10000) As String
Dim log_ctr As Integer
Open App.Path & "\data\log.txt" For Input Lock Read As #1
Do Until EOF(1)
Line Input #1, line(log_ctr)
log_ctr = log_ctr + 1
Loop
Close #1
If last_log <> log_ctr Then
For n = last_log To log_ctr - 1
Text1.SelStart = Len(Text1.Text)
Text1.SelText = line(n) & vbCrLf
End if
Next
last_log = log_ctr
End If

End Sub

View attachment 46444



yan tapos na tayo ^_^ may account login na at may logs and connect button na..

paano po yung sa Globe or Smart?

Part 3 para sa globe or smart option ^_^

gawa tayo ng 2 option button
para saan na naman toh?

option1 = (Name) = Smart (Caption) = Smart
option2 = (Name) = Globe (Caption) = Globe

kapag nalagay na ulit natin lahat yan sa kanya kanya nilang properties double click naman po natin yung option1 button (smart)
para malagyan ulit natin ng code


Private Sub Smart_Click()
netw = smart.Caption
smart.Caption = "Smart"

End Sub

Private Sub Globe_Click()
netw = smart.Caption
smart.Caption = "Globe"

End Sub

then pakilagay ito sa pinakaitaas ng form code nyo

Dim netw As String

pag nailagay nyo na yan balik na tayo sa connect button double click nyo ulit para mapunta sa code nya.

tapos ayusin natin yung code nya kasi nagdagdag tayo ng option

Private Sub connect_Click()
If netw = "Smart" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

If netw = "Globe" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

End Sub

View attachment 46449


o ayan tapos na tayo sa part 3 natin ^_^

ano pa ba?

paano kung dalawa or madami ang server nyo?

madali na lang din yan ^_^ eto sa part 4

Part 4 Server selection

gawa po tayo ng isang combo box
paano po ang gagawin sa combo box?

combo box (Name) = server (Enabled) = False
then paki delete yung nasa text nya.

then
sa form load natin ilagay natin ito

Server.AddItem ("Server-1")
Server.AddItem ("Server-2")

bali magiging ganito ang form load nyo

Private Sub Form_Load()
Server.AddItem ("Server-1")
Server.AddItem ("Server-2")

End Sub

then balik tayo sa Smart option and globe option then
burahin nyo na yung netw = smart.caption na nilagay natin then dagdagan natin ng server.Enabled = true

Private Sub Smart_Click()
smart.Caption = "Smart"
server.Enabled = True
End Sub

Private Sub Globe_Click()
smart.Caption = "Globe"
server.Enabled = True
End Sub

tapos double click nyo yung combo box na ginawa natin and dito natin ilagay yung netw =smart.Caption + server.Text

Private Sub Server_Click()
netw = smart.Caption + server.Text
End Sub

then dun na ulit tayo sa connect mag babago...

Private Sub connect_Click()
If netw = "SmartServer-1" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

If netw = "GlobeServer-1" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

If netw = "SmartServer-2" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

If netw = "GlobeServer-2" then
Shell App.Path & "\bin\openvpn --tls-client --client --dev tun --remote x.x.x.x --proto udp --port 9200 --lport 53 --persist-key --persist-tun --ca data\ca.crt --comp-lzo --mute 3 --tun-mtu 1500 --auth-user-pass data\account.txt --reneg-sec 0 --keepalive 10 120 --route-method exe --route-delay 2 --verb 3 --log data\log.txt --status data\stat.db 1", vbHide
End If

End Sub

View attachment 46450

O tapos na ba tayo? may nakalimutan pa ba ako?

ahh Screen shot... wait eto na isusunod ko na..

Thanks to:
Kaz
gnod1
mp3sniff
ggmreg


maraming salamat sa inyo... kung hindi dahil sa mga tulong nyo hindi ako makakagawa nito... 1 week pa lang akong gumagamit ng VB nyan ^_^

yung ibang nag post sa thread iback read ko pa para malagay ko sa thanks :)

eto pala yung mga file ko dito nyo ilalagay yung gawa nyo na exe

View attachment 46442






eto na yata inaantay nyo yung finish product na :yipee:View attachment 46452
 

Attachments

  • untitled.JPG
    untitled.JPG
    71.9 KB · Views: 1,391
  • 1st.JPG
    1st.JPG
    43.9 KB · Views: 877
  • 2nd.JPG
    2nd.JPG
    35.3 KB · Views: 578
  • 3rd.JPG
    3rd.JPG
    45.3 KB · Views: 491
  • 4th.JPG
    4th.JPG
    45.3 KB · Views: 599
  • TUT.rar
    8.3 KB · Views: 2,927
Last edited:
ayu... una ^_^ tnx TS hehehe gawa ako ulit
 
Timer (Name) = log_Timer (Enabled) = False (Interval) = 250 <---- yan ang magbabasa ng status ng openvpn natin at mag rerefresh sa textbox3 natin
textbox3 (Name) = logs <---- para sa logs yan
command button (Name) = connect (capton) = Connect <---- para naman sa connect buttong natin

san to bro NOOB ako d ko magets!cenxa na ha
 
Last edited:
post updated ^_^
 
VB6? san makakakuha nito? noob pagdating sa ganito!!!:noidea:
 
SYNTAX ERROR Bro

Private Sub save_Click()
Open App.Path & ("\data" "/" + Account + "Account.txt") For Output As #1
 
SYNTAX ERROR Bro

Private Sub save_Click()
Open App.Path & ("\data" "/" + Account + "Account.txt") For Output As #1

bro na update ko na yung post may mali kasi... yan ayos na ngayon :) then may nakaupload na din na form ^_^
 
ts wala akong vb6 baka pahingin naman ng link para madownload at maumpisahan yung project mo pa MF ts...
 
bookmark ulit.. mas mabilis to ^_^ hehehehe

boss plagay din ng auto update ^_^ slamat! ^_^
 
wow VB6
Pa Post din ng gawa sa VB.NET 2010
attachment.php


attachment.php


attachment.php


attachment.php
 

Attachments

  • GUI1.jpg
    GUI1.jpg
    33.8 KB · Views: 1,199
  • GUI2.jpg
    GUI2.jpg
    24.7 KB · Views: 1,179
  • GUI3.jpg
    GUI3.jpg
    22.1 KB · Views: 1,167
Back
Top Bottom