惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
U
Unit 42
罗磊的独立博客
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
F
Fortinet All Blogs
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
博客园 - 【当耐特】
H
Help Net Security
The GitHub Blog
The GitHub Blog

博客园 - DarroldYang

linux 多线程,锁同步 Saas模式数据库层数据架构以及数据删除处理 ASP.NET MVC 自定义过滤属性实现Enterprise的log功能 ASP.NET MVC 请求生命周期 ASP.NET MVC HtmlHelper类的方法总结 - DarroldYang (Windows 7 IIS 7.5里面的 IIS and Built-in Accounts) IIS和内置帐户的IIS 用户控件,事件的触发顺序 IIS7.0 An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode 转ORACLE函数大全 ASP.NET AJAX 调用Service Method (Too simply) Office编程知识点汇总(3)--格式设置 Office编程知识点汇总(2)--基本工作表任务 Office编程知识点汇总:基本工作簿任务 asp.NET应用程序的技巧 CrystalReport的导出“Push”方式 Ajax Control Toolkit MutuallyExclusiveCheckBox 服务器端控件 Ajax Control Toolkit Slider 服务器端控件 Ajax Control Toolkit AlwaysVisibleControl 服务器端控件 Ajax Control Toolkit Accordion 服务器端控件
判断代码执行环境
DarroldYang · 2008-10-20 · via 博客园 - DarroldYang

展翅高飞

关注经济,从事Unix,移动互联网产品开发,一步一个台阶.无限正能量...

判断代码执行环境

在类库内部可以通过 System.Web.HttpContext.Current 来判断当前代码是运行于 ASP.net 工程还是 WinForm/Console。

1 using System.Web;
2 
3 
4 
5 if (System.Web.HttpContext.Current != null)
6   Debug.WriteLine("运行于 ASP.net ");
7 else
8   Debug.WriteLine("运行于 WinForm/Console ");
9 

posted on 2008-10-20 08:46  DarroldYang  阅读(288)  评论(0)    收藏  举报

刷新页面返回顶部