I had an interesting conversation recently where I was told that Microsoft .NET is not secure since it is more easily reverse engineered than languages like C. Is there any validity in this? If I were to write a section of code which I did not want to have reverse engineered, would writing it in C provide that much additional security? I'm no expert on the subject so I'm interested in what the sage people of IS have to say.
Are you looking to protect the code because of an intellectual property requirement the person/company you are writing the code for has? Then I guess writing it in C could make it a bit more challenging to decompile, but someone with the required motivation and skills would go around that by reverse engineering it using many of the available tools; maybe a dissembler like IDA: Wikipedia - Interactive Disassemler
On the other hand, if you are looking to hide the logic of your application in order to make it difficult to find vulnerabilities, you are going down the path of "security by obscurity", which is quite worthless from an application security perspective. As wireghoul said, this logic would imply that all closed source applications would be secure and open source software would be a disaster. In fact, both have the same families of vulnerabilities and flaws that are exploitable.
I would instead invite you to invest some time looking at Secure Coding Practice Guidlines and Core Security Concepts. A quick lookup on Google about those topics will guide you and there is also plenty of good literature on this subject.