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
Post a Comment