VB program works fine when stepping through but crashes when ran with the .exe
This is a weird persistant issue I am having with a small visual basic program.
Problem: The excutable of the vb program crashes when trying to run but when I step thr开发者_高级运维ough the program inside of visual studio it runs successfully.
Details: The program performs a winscp.com transfer from a ftp server and then takes the downloaded file and extracts the data from it before sending it to a webpage. The program also decrypts a des3 encrypted file which holds the login details for the sftp server and the webpage.
My Thoughts: I was thinking this could be something to do with the excutable jumping ahead of the slower transfer and decrypt functions thus causing a "file not found" exception to be produced and the program to exit. Lending to this if I slowly (aka spend 10+ seconds stepping through the code) move through the code it works just fine.
Solution: I was thinking of including some kind of checks inside the program to make sure that the file exsists before moving on but I still wanted to get your guys opinion.
Thanks!
As requested Crash Messages: (I capture everything in exceptions and exit properly so no "crash" is reported but the error I get in my logs is as follows:)
1st run with standard test case: Could not find file 'C:\Users\Administrator\Desktop..\ILC2INFOENC.txt'
2nd run standard case (the file above was not deleted by my cleanup function either as it could not be found) Could not find file 'C:\Users\Administrator\Desktop..\ILCNETSL10663.csv'
Background: The first file that is found missing is the encrypted login information file while the second file is the winscp.com downloaded csv file.
Thanks again for all the help and suggestions.
Solution: Applied checks to the existance of the files in question as to keep the vb program from jumping ahead of the slower moning openssl decrypt and the winscp file transfer. If I had the time to redo this portion of code I would have utilized the .net framework provided sftp function and the decrypter instead of winscp and openssl as to better control the flow of the program! If you need more options check below the original question for different takes of this issue.
精彩评论