GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
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, mar., 27 2017 10:40 AM - 1 resposta
Conecte-se…
amarildo
#1
Membro registado
535 mensagems
Popularité : +14 (14 votes)
Publicado em março, 27 2017 - 10:40 AM
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
Mensagem modificada, março, 27 2017 - 10:42 AM
Denunciar
1
0
amarildo
#2
Membro registado
535 mensagems
Popularité : +14 (14 votes)
Publicado em março, 28 2017 - 11:15 AM
Denunciar
0
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto