segunda-feira, 27 de março de 2017

Aula 1103 - Windev - Certificado 011/... - DonwLoad Arquivo/Barra Progresso/Http









Video no Youtube Se Gostou clique aqui para dar joinha



Nessa aula de hoje
vou ensinar a fazer DownLoad Arquivo
usar Barra de Tarefas com
Http




http://doc.windev.com/en-US/?3043004&name=http_functions

https://doc.windev.com/en-US/?3043009&name=HTTPProgressBar   
https://doc.windev.com/en-US/?3043007&name=httprequest_function
https://doc.windev.com/en-US/?3043001&name=HTTPGetResult
https://doc.windev.com/en-US/?1514042&name=Buffer_type
https://doc.windev.com/en-US/?1000019412&name=fSaveBuffer



Blog - WinDev - Curso Certificado - 001/... - Seleciona Certificado - Certificate Select 
Blog - WinDev - Curso Certificado - 002/... - Certificate Type - Pegar Dados Certificado
Blog - WinDev - Curso Certificado - 003/... - Ver se Certificado é Válido
Blog - WinDev - Curso Certificado - 004/... - CertificateLoad - Chamar pfx/arquivo
Blog - WinDev - Curso Certificado - 005/... - Assinatura Digital Nfe - Parte 1/...
Blog - WinDev - Curso Certificado - 006/... - Assinatura nfe - Parte 2/... - System.xml.xmlDocument
Blog - WinDev - Curso Certificado - 007/... - Assinatura nfe - Parte 3/... - Assinar Documento
Blog - Windev - Curso Certificado - 008/... HttpListCertificate
Blog - WinDev - Curso Soap - 009/... Consulta Cadastro Sefaz - WebService
Blog - WinDev - Curso Soap - 010 - Status Nfe Sefaz - WebService
DonwLoad Arquivo/Barra progresso/Http - WinDev - Certificado 011/...
CertificateSelect - DICAS 1955 - PUBLICA - WINDEV - Certificado 12 -


//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  // Se arquivo existe for igual a verdadeiro
    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)  // fSaveBuffer = Cria e preenche um arquivo externo com o conteúdo de uma string
        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






















Teste

Teste
teste