Object reference not set to an instance of an object 为什么只有一台电脑一直出现这个错识?其它电脑全部没有问题?
代码如下:
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
powers();
names();
}
}
/// <summary>
/// 返回权限值
/// </summary>
/// <returns></returns>
protected string powers()
{
power = cookeis.Values["power"];
return power;
}
/// <summary>
/// 返回工号BM
/// </summary>
/// <returns></returns>
protected string names()
{
name = cookeis.Values["uName"];
return name;
}
}
我也按照这个贴子:http://topic.csdn.net/u/20080305/10/4d3080a6-0000-45a8-a1ed-bb037447543f.html
试了,一下,也不行啊?郁闷死了,我现在怀凝是不是那台电脑硬盘有问题,存不住COOKie啊??
代码如下:
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
powers();
names();
}
}
/// <summary>
/// 返回权限值
/// </summary>
/// <returns></returns>
protected string powers()
{
power = cookeis.Values["power"];
return power;
}
/// <summary>
/// 返回工号BM
/// </summary>
/// <returns></returns>
protected string names()
{
name = cookeis.Values["uName"];
return name;
}
}
我也按照这个贴子:http://topic.csdn.net/u/20080305/10/4d3080a6-0000-45a8-a1ed-bb037447543f.html
试了,一下,也不行啊?郁闷死了,我现在怀凝是不是那台电脑硬盘有问题,存不住COOKie啊??
解决方案 »
- C#WinForm DataGridView绑定了数据库 当数据库数据更新时如何使DataGridView自动更新数据
- 求一个取数字的方法
- ********* updatepanel 实现局部登录退出的问题 **********
- richtextbox 功能实现问题?
- ThreadSharp 请进! 请问这样取CPU编号会不会重复?
- 非常奇怪,Timer多线程中不执行
- 中文输出至Excel乱码问题
- C#中用ibatis调用Oracle数据库存储过程问题
- .net 怎么在调用word文件时不打开word进行读取word的内容?
- 请教C#中DATAGRIDE的使用方法
- input输入框光标一闪就消失,根本不能输入文本
- 求助 c#简单问题
为null
客户端浏览器中禁止 Cookie
在web.config
sessionstate 节把cookieless设为trueps:好久没写程序可能有小问题
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.
/// 返回权限值
/// </summary>
/// <returns></returns>
protected string powers()
{
power = cookeis.Values["power"];
建议
if(power ==null)return "NULL";
return power;
}
/// <summary>
/// 返回工号BM
/// </summary>
/// <returns></returns>
protected string names()
{
name = cookeis.Values["uName"];
建议
if(name==null)return "NULL";
return name;
}
这两个return 可能为null 对后续有可能对null对象进行操作 问题不在你贴 的代码里 在你对后续返回的操作
cookie别禁用