c# - How to know the project type programmatically? -


i having file in project. file used other projects. want show messages in file using console console projects, , messagebox windows application projects. so, want know project type programatically.can how achieve this?

note: file in c# language.

edit: david's answer way have follow. but, near release date. so, need use project type temporary solution. there way that?

test if there main windows, if not must in console application :

if (process.getcurrentprocess().mainwindowhandle == intptr.zero) { console.writeline(...); } else { // message box code .... } 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -