Object reference not set to an instance of an object的问题???

liuyuer 2003-10-19 10:36:09
Server Error in '/webapplication1' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 103: urlCanshu = Request("urlCanshu")
Line 104: skey = Request("skey")
Line 105: Label3.Text = "欢迎您,来自ip地址为:" + Request.UserHostAddress + "的朋友"
Line 106:
Line 107:


Source File: C:\Inetpub\wwwroot\WebApplication1\show.aspx.vb Line: 105

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
vod.show.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\WebApplication1\show.aspx.vb:105
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
...全文
101 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
竹君子 2003-10-19
  • 打赏
  • 举报
回复
出现问题是因为
此刻没有客户机访问你的服务器
所以你取不到值
try{

Label3.Text = "欢迎您,来自ip地址为:" + Request.UserHostAddress + "的朋友"

}
catch{}
就不报错了
竹君子 2003-10-19
  • 打赏
  • 举报
回复
用Request.UserHostName
竹君子 2003-10-19
  • 打赏
  • 举报
回复
Request.UserHostAddress 没有取到值

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧