如何确定是否卡西尼号是什么运行Web应用程序? [英] How to determine if Cassini is what's running your web app?

查看:110
本文介绍了如何确定是否卡西尼号是什么运行Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,这个问题的标题 - 我怎么能/是可以确定的卡西尼号是在运行我的应用程序与IIS?基本上,我希望我的code要知道,这只不过是调试,所以如果我想的东西更容易在这里,请指出来。

Basically, the question in the title - how can I / is it possible to determine that Cassini is what's running my app versus IIS? Basically I want my code to know that it's debugging, so if I'm missing something easier here, please point it out.

推荐答案

虽然我想了很多的想法在这里,我想我发现做到这一点的简单方法。

While I like a lot of the ideas here, I think I found a simple way to accomplish this.

System.Diagnostics.Debugger.IsAttached

这给出了一个布尔视是否有连接到执行code调试器。

This gives a boolean depending on whether there's a debugger attached to the executing code.

我还是喜欢#如果 code。通过VC 74提供的,但是这code提供我的目的比较好。

I still like the #if code provided by vc 74, but this code serves my purpose better.

这篇关于如何确定是否卡西尼号是什么运行Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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