我正在使用.Net 3.5 SP1运行IIS 7
任何人都可以告诉我这是否是线程安全的,因为它在高负载的用户下继续失败:
private static void addQueryStringParameters(XElement inputs)
{
NameValueCollection qs = HttpContext.Current.Request.QueryString;
XElement queryStringParameters = new XElement("QueryStringParameters");
foreach (string key in qs.AllKeys)
{
try
{
if (!String.IsNullOrEmpty(key))
-- some code qs[Key]
}
catch (Exception exception)
{
-- some code
}
}
}
如果它是线程安全的那么为什么它会失败...?
顺便说一句,我得到的例外是:object reference not set
。