Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identify if ZIP File is Corrupted
Message
De
24/04/2013 16:09:51
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brésil
 
 
À
24/04/2013 15:06:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01571775
Message ID:
01571801
Vues:
30
>>How can I to identify if ZIP file is corrupted, through VFP?
>
>Following what Rick has said, the parsing of the output may be elaborated as follow. This is what I use in the .NET Zip class I have built. But, this code is easily transportable to VFP:
>
>                    ' If we have an output
>                    If loProcessfile.cOutput.Length > 0 Then
>
>                        ' Make it available in case the client needs it
>                        cCommandLineFullOutput = loProcessfile.cOutput
>
>                        ' Remove empty lines
>                        cCommandLineFullOutput = oApp.StrTran(cCommandLineFullOutput, oApp.cCR + oApp.cCR, oApp.cCR)
>
>                        ' End-of-central-directory signature not found.
>                        If oApp.At("End-of-central-directory signature not found.", loProcessfile.cOutput) > 0 Then
>                            cMessage = cEndOfCentralDirectorySignatureNotFound
>                            Exit For
>                        End If
>
>                        ' End-of-central-directory signature not found.
>                        If oApp.At(" CRC check failed", loProcessfile.cOutput) > 0 Then
>                            cMessage = oApp.StrTran(cTheFileIsCorrupted, "##File##", cFile)
>                            Exit For
>                        End If
>
>                        ' If we have a caution
>                        lnLocation = oApp.At("CAUTION: ", UCase(cCommandLineFullOutput))
>
>                        ' If we did not find it
>                        If lnLocation = 0 Then
>
>                            ' If we have an error
>                            lnLocation = oApp.At("FATAL ERROR: ", UCase(cCommandLineFullOutput))
>
>                            ' If we did not find it
>                            If lnLocation = 0 Then
>
>                                ' If we have an error
>                                lnLocation = oApp.At("ERROR: ", UCase(cCommandLineFullOutput))
>
>                            End If
>
>                        End If
>
>                        ' If we found one
>                        If lnLocation > 0 Then
>                            cMessage = Mid(cCommandLineFullOutput, lnLocation)
>
>                            ' If we have a carriage return
>                            lnLocation = oApp.At(oApp.cCR, cMessage)
>
>                            ' If we found it
>                            If lnLocation > 0 Then
>                                cMessage = Mid(cMessage, 1, lnLocation - 1)
>                            End If
>
>                            Exit Try
>                        End If
>
>                    End If
Michel,

Thanks!
Erick
Força Sempre!
Strength Always!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform