How to know the project type programmatically?
===

I am having a file in my project. This file is used by some other projects. I want to show some messages in this file using console for console projects, and Messagebox for Windows Application projects. So, I want to know the project type programatically.Can anybody say how to achieve this?

Note: The file is in C# language.