如何deterimine净DLL中是否使用一个GUI应用程序或网络服务? [英] How to deterimine whether .Net DLL is used in a GUI app or web service?

查看:182
本文介绍了如何deterimine净DLL中是否使用一个GUI应用程序或网络服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何确定在.NET的DLL无论是在Windows GUI应用程序或Web服务上运行?我有正在被两个应用程序,需要关闭消息框之间共享,当它在一个Web服务的使用水平低的类。

How do I determine in a .Net DLL whether it's running in a Windows GUI application or web service? I've got a low level class which is being shared between two applications and need to disable message boxes when it's used in a web service.

Windows应用程序中有超过200个解决方案,我不是在一个位置,重新因素现有code。 Web服务需要重复使用某些功能,我正在寻找一个快速解决方案。

The Windows application has over 200 solutions and I'm not in a position to re-factor the existing code. The web service needs to reuse some functionality and I'm looking for a quick fix.

推荐答案

只是一块普通的建议,你的低级别类可能不能使用消息框本身,而应让中间(靠近接口)类处理情况下,您可能希望一个消息。

Just a piece of general advice, your low level class should probably not be using the message boxes itself, but should allow an intermediate (closer to the interface) class to handle cases where you might want a messagebox.

如果你这样做,那么你会简单地使用不同的高层类的网络比桌面,每个将有适当的上下文通知工具。

If you did this, then you'd simply use different higher-level classes for the web than for the desktop, and each would have notification facilities appropriate to its context.

这篇关于如何deterimine净DLL中是否使用一个GUI应用程序或网络服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆