FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV 25
→
Aula 1103 - Windev - Certificado 011/... - DonwLoad Arquivo/Barra Progresso/Http
Aula 1103 - Windev - Certificado 011/... - DonwLoad Arquivo/Barra Progresso/Http
Iniciado por amarildo, 27,mar. 2017 10:40 - 1 respuesta
Conéctese…
amarildo
#1
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 27,marzo 2017 - 10:40
Nessa aula de hoje
vou ensinar a fazer DownLoad Arquivo
usar Barra de Tarefas com
Http
//Com comentarios
b
_fazer_download
is boolean
=
True
// Criando uma Variavel Chamado fazer donwLoad e sera verdadeiro ou falso
// Creating a Callable Variable make donwLoad and will be true or false
_arquivo_existe
is boolean
=
fFileExist
(
"d:\amarildo\dll_dia_233.zip"
)
// Criando Variavel arquivo existe que sera verdadeiro ou falso e vou verificar se o arquivo existe
// Creating Variable file exists that will be true or false and I will check if the file exists
IF
_arquivo_existe
=
True
THEN
// Se arquivo existe for igual a verdadeiro
IF
YesNo
(
"Arquivo já existe, deseja refazer download?"
)
THEN
// Estou perguntando se desejo fazer download
ELSE
//Senao
b
_fazer_download
=
False
// dizendo que fazer download é igual a falso
END
END
IF
b
_fazer_download
=
True
THEN
//Se fazer donwload for igual a verdadeiro
PROGBAR_download
..
Visible
=
True
// tornando visivel a barra de progresso
HTTPProgressBar
(
PROGBAR_download
)
// Mostra Barra de tarefa enquanto estiver executando Consulta Http
// Show Taskbar while running httpProgressBar
_arquivo
is boolean
=
HTTPRequest
(
"http://www.matosinformatica.com.br/Arquivos/dll_dia_233.zip"
)
// Inicia uma solicitação HTTP em um servidor. O resultado da consulta pode ser:
// Salvo em um arquivo de backup por HTTPDestination
// Recuperado por HTTPGetResult .
// Starts an HTTP request on a server. The result of the query can be:
// Saved in a backup file by HTTPDestination
// Recovered by HTTPGetResult
HTTPProgressBar
(
""
)
// Cancela barra progresso
// Cancel progress bar
IF
_arquivo
=
True
THEN
// Se arquivo for igual a verdadeiro
// If file is equal to true
_baixar_arquivo
is
Buffer
=
HTTPGetResult
(
)
// buffer = O tipo de buffer corresponde a uma zona de memória binária
// HTTPGetResult = Recupera o resultado ou o cabeçalho da última execução de solicitação HTTP.
// Esta solicitação foi iniciada por HTTPRequest ou por HTTPSendForm
// Buffer = The buffer type corresponds to a binary memory zone
// Retrieves the result or the header of the last HTTP request execution.
// This request was initiated by HTTPRequest or by HTTPSendForm
_arquivo
=
fSaveBuffer
(
"d:\amarildo\dll_dia_233.zip"
,
_baixar_arquivo
)
// fSaveBuffer = Cria e preenche um arquivo externo com o conteúdo de uma string
// ou variável de buffer. Se o arquivo já existir, ele será excluído e recriado
// FSaveBuffer = Creates and fills an external file with the contents of a string
// Or buffer variable. If the file already exists, it will be deleted and recreated.
IF
_arquivo
=
True
THEN
Info
(
"Download efetuado com sucesso!'"
)
// Se arquivo for verdadeiro, sucesso donwload // If file is true, download success
ELSE
Error
(
"Não foi possivel efetuar o download."
)
// Senão deu erro // Otherwise,
END
END
END
//Sem Comentarios
b
_fazer_download
is boolean
=
True
_arquivo_existe
is boolean
=
fFileExist
(
"d:\amarildo\dll_dia_233.zip"
)
IF
_arquivo_existe
=
True
THEN
IF
YesNo
(
"Arquivo já existe, deseja refazer download?"
)
THEN
ELSE
//Senao
b
_fazer_download
=
False
END
END
IF
b
_fazer_download
=
True
THEN
PROGBAR_download
..
Visible
=
True
HTTPProgressBar
(
PROGBAR_download
)
_arquivo
is boolean
=
HTTPRequest
(
"http://www.matosinformatica.com.br/Arquivos/dll_dia_233.zip"
)
HTTPProgressBar
(
""
)
IF
_arquivo
=
True
THEN
_baixar_arquivo
is
Buffer
=
HTTPGetResult
(
)
_arquivo
=
fSaveBuffer
(
"d:\amarildo\dll_dia_233.zip"
,
_baixar_arquivo
)
IF
_arquivo
=
True
THEN
Info
(
"Download efetuado com sucesso!'"
)
ELSE
Error
(
"Não foi possivel efetuar o download."
)
END
END
END
http://windevdesenvolvimento.blogspot.com.br/2017/03/aula-1103-windev-certificado-011.html
https://www.youtube.com/watch?v=NNy_ErcBM_I
Mensaje modificado, 27,marzo 2017 - 10:42
Informar
1
0
amarildo
#2
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 28,marzo 2017 - 11:15
Informar
0
0
→ Volver a WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto