gpt4 book ai didi

c# - 系统.NullReferenceException : Object reference not set to an instance of an object in C#

转载 作者:太空宇宙 更新时间:2023-11-03 20:27:28 25 4
gpt4 key购买 nike

<分区>

我在我的global.asax 文件中编写了以下代码

void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
ConnStr = objConnStr.GetConnectionString();


if (HttpContext.Current.Session["LOGIN"] != null )

{
}
}

它在 *HttpContext.Current.Session["LOGIN"] *

处抛出以下错误

描述:在执行当前网络请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.NullReferenceException:未将对象引用设置为对象的实例。

可能是什么问题?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com