PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
[WINDEV19][WINDEV MOBILE 19] Como conectar-se a uma VPN
[WINDEV19][WINDEV MOBILE 19] Como conectar-se a uma VPN
Started by pedrosao, Feb., 21 2015 2:43 AM - No answer
Connect yourself…
pedrosao
#1
Registered member
42 messages
Popularité : +7 (7 votes)
Posted on February, 21 2015 - 2:43 AM
A função NetOpenRemoteAccess permite estabelecer uma conexão remota e especialmente uma conexão VPN.
A função NetCloseRemoteAccess permite fechar a conexão.
Por exemplo, para estabelecer uma conexão remota com um PC
// Inicia uma conexão de internet em um PC
// O nome da conexão usa o nome definido na conexão do Painel de controle.
Report is
int
=
NetOpenRemoteAccess
(
"Connection_LiveBox"
)
IF
Report
=
0
THEN
...
NetCloseRemoteAccess
(
)
ELSE
Error
(
"Error durante a conexão"
,
NetMsgError
(
Report
)
)
END
Para abrir uma conexão em um smartphone
// Abre uma conexão a partir de um Smartphone
s
ConnectionName is
string
n
CntReturn is
int
// Nome da conexão é dado pelo provedor
s
ConnectionName
=
"Bouygues Internet"
// Estabiliza a conexãon
n
CntReturn
=
NetOpenRemoteAccess
(
s
ConnectionName
)
IF
n
CntReturn
=
0
THEN
// Processo requerido
// ...
NetCloseRemoteAccess
(
s
ConnectionName
)
ELSE
Error
(
"Erro durante a conexão:"
,
NetMsgError
(
n
CntReturn
)
)
END
O retorno desta função é um inteiro com as seguintes características:
0 (zero) se a conexão for bem sucedida;
De outra forma, ocorre um erro que pode ser especificado pela função NetMsgError.
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text