PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

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
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
Miembro registrado
535 mensajes
Popularité : +14 (14 votes)
Publicado el 28,marzo 2017 - 11:15