PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → Usando SWITCH Dialog() ou If YesNo()
Usando SWITCH Dialog() ou If YesNo()
Iniciado por Boller, dez., 16 2020 7:36 PM - Sem resposta
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em dezembro, 16 2020 - 7:36 PM
//1 : Sim
//2 : Não
SWITCH Dialog("Deseja criar as regras de liberação do Firewall?")

CASE 1
//Libera Firewall

sLiberarPortaEntradaRadmin is string = "netsh advfirewall firewall add rule name="+Charact(34)+"Radmin Open IN Port"+Charact(34)+" protocol=TCP dir=IN localport=4899 action=allow"

sLiberarPortaSaidaRadmin is string = "netsh advfirewall firewall add rule name="+Charact(34)+"Radmin Open OUT Port"+Charact(34)+" protocol=TCP dir=OUT localport=4899 action=allow"

sLiberaProgINWxTarifador is string = "netsh advfirewall firewall Add rule name="+Charact(34)+"Wx Tarifador Open IN"+Charact(34)+" dir=IN program="+Charact(34)+"c:\Program files\WxTarifador\WxTarifador.exe"+Charact(34)+" action=allow"

sLiberaProgOUTWxTarifador is string = "netsh advfirewall firewall Add rule name="+Charact(34)+"Wx Tarifador Open OUT"+Charact(34)+" dir=OUT program="+Charact(34)+"c:\Program files\WxTarifador\WxTarifador.exe"+Charact(34)+" action=allow"

sMensagem is string = "@Echo off"+CR+CR+"cls"+CR+CR+"echo Abra o MS-DOS com o direito do mouse como administrador e execute essas regras de firewall"

sPathAtual is string = "cd\"+CR+CR+"cd "+fCurrentDir()

sAbreFirewall is string = sMensagem +CR+CR+ sPathAtual +CR+CR+
sLiberarPortaEntradaRadmin +CR+CR+
sLiberarPortaSaidaRadmin +CR+CR+
sLiberaProgINWxTarifador +CR+CR+
sLiberaProgOUTWxTarifador +CR+CR+"pause"

fSaveText(fCurrentDir()+"\Firewall.txt", sAbreFirewall)

ExeRun("notepad.exe "+fCurrentDir()+"\Firewall.txt", exeActive, True)

Info("Caso não funcione abra o prompt do msdos como administrador e execute esses comandos do bloco de notas que vão criar as regras de liberação de entrada e saida dos programas: Radmin e Wxtarifador")

CASE 2

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/