Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Things in .NET Framework 4 that every programmer should know

10 like 0 dislike
Hello,

       I recently moved to Visual Studio 2010 and upgraded my website to work with .NET Framework 4. (From VS 2008 - Framework 3.5)

What are things I need to know to improve site speed, readability or memory use?
 


Thanks.................
asked 1 year ago by biswaskeran (70,430 points)

1 Answer

0 like 0 dislike
DivideByZeroException

int SafeDivision(int x, int y)
{
    try
    {
        return (x / y);
    }
    catch (System.DivideByZeroException dbz)
    {
        System.Console.WriteLine("Division by zero attempted!");
        return 0;
    }
}
answered 1 year ago by tulip (12,960 points)

Related questions

8 like 0 dislike
1 answer
11 like 0 dislike
2 answers
4 like 0 dislike
1 answer
3 like 0 dislike
2 answers