Greetings,

I have been trying to see all the files in computer, but since accesses of some files are denied my program throws exception. When I show the type of exception with a MessageBox I learnt it is about mscorlib.dll. I can make my program run not throwing exception using assemblies. But if I wanted to prevent the program to throw exception what would you suggest to me to do? Should I download and set up, or I saw somebody had a similar problem and he solved it uploading related file, *.dll . By the way, I use C# for my application.

Thanks everybody

Hi there!
"But if I wanted to prevent the program to throw exception what would you suggest to me to do?"
Hm... well you can always use the 'try-catch' structure ,with an empty catch part.
Example:

static void Main(string[] args)
{
            char[] ch = new char[1]{'2'};
            try { Console.WriteLine(ch[-1]); }//this is useless but it's simple and throws error ^^( since there is no -1 indexed element in an array)
            catch {/*Write the code to be executed if the code in the try{} part throws an exception, leave it empty if you want to ignore the exceptions.*/}
}

I hope this helps.
Andrew

Edited 6 Years Ago by andrewll2: to make it easier to understay...

Hi dear friend,

I already solved this problem at the day I asked. But thanks.

Note: I follow a smilar way, leaving catch empty, without any code. Because , openning all the folders is not the point I focus on.

Thanks,
m.a.u.

This question has already been answered. Start a new discussion instead.