| | |
errors make me close program
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
Hey guys, i got this program im making. It encrypts and decrypts files. The problem is that whenever an error occurs while encrypting or decrypting ( having put a read-only file, a running program, input wrong keys, enter wrong encryption type...) the program tells me that an error occured. Thats nice and everything but i have to close the program, restart it and then try again. I can't just correct the mistake. If i do correct the mistake and try again, i get an error message again.
Basically i want to be able to correct mistakes without having to restart program. Does anyone know what to do?
It'll be great if someone can. Thanks in advance!
Basically i want to be able to correct mistakes without having to restart program. Does anyone know what to do?
It'll be great if someone can. Thanks in advance!
:eek: Come and visit SharpCreativity.com :eek:
To summarize, you want to know how to write a robust program. Unfortunately, that's an art that takes experience and practice. There aren't really any tricks to it. Just know what errors could possibly happen and write code to handle them gracefully (such as with try..catch blocks).
I'm here to prove you wrong.
obviously everyone would want to create a perfect program, but you know it doesnt always work out to plan. ok concerning the try...catch blocks, i already got that. Whenever an error occurs in the process, it tells me! thats fine and great! BUT, if i try to do the process again, it gives an automatic error, even though the information it wants is correct! I have to close the program to be able to make it work.
i was wondering if there was some sort of code that involves a "dispose" code for an open file. I would like ti put that in the catch block
i was wondering if there was some sort of code that involves a "dispose" code for an open file. I would like ti put that in the catch block
:eek: Come and visit SharpCreativity.com :eek:
Just because it tells you there's an error doesn't mean your using try/catch block correctly. It will tell you there is an error even if you have any try/catch blocks. You need to try to handle the error in the try catch block.
From what you described, you need to reset the variables you're using inside the try/catch blocks or reset them when the encrypting is done (i.e. in a finally block). I'm like 99.99% sure that's what your problem is.
From what you described, you need to reset the variables you're using inside the try/catch blocks or reset them when the encrypting is done (i.e. in a finally block). I'm like 99.99% sure that's what your problem is.
i dont think you understand... i programmed it to tell me there is an error. But i don't know, like you say, handle the error.
would you know some sort of reset code?
would you know some sort of reset code?
:eek: Come and visit SharpCreativity.com :eek:
![]() |
Similar Threads
- windows xp (IT Professionals' Lounge)
- TIc Tac Toe Check (C++)
- Need help resolving errors for a simple program (Java)
Other Threads in the C# Forum
- Previous Thread: Geometric Art using Triangles (C#)
- Next Thread: On-the-fly string generation
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mailmerge mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot save saving serialization server sleep socket sockets sql sql-server statistics stream string stringformatting sun table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






