PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Aula 1103 - Windev - Certificado 011/... - DonwLoad Arquivo/Barra Progresso/Http
Aula 1103 - Windev - Certificado 011/... - DonwLoad Arquivo/Barra Progresso/Http
Started by amarildo, Mar., 27 2017 10:40 AM - 1 reply
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on March, 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
Message modified, March, 27 2017 - 10:42 AM
Report
1
0
amarildo
#2
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on March, 28 2017 - 11:15 AM
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