【发布时间】:2009-04-19 13:02:40
【问题描述】:
静态异常实例可以安全使用吗?有什么好的理由可以避免以下情况?
public class ResourceHttpHandler : IHttpHandler
{
private static HttpException notFoundException =
new HttpException(
(int)HttpStatusCode.NotFound,
"Assembly Not Found");
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
....
throw notFoundException;
....
}
}
【问题讨论】:
标签: c# multithreading exception