I wrote a program and sent the compiled file to my friend. but after an hour, he sent me the code of that! How did he do that. And how can i prevent it? is this problem just in .net?
It can be done with reflector. If you want make it difficult for people to understand the code, you have to ofuscate it (there are tools to do dat, like dotfuscator).
I don't know if it's a .NET only problem...