首页 优化推广 HttpContext.Current.User.Identity.Name为什么获取的是自己的机器名

HttpContext.Current.User.Identity.Name为什么获取的是自己的机器名

来源: | 时间:2011/4/9 8:45:09 |

有可能突然某天发现

HttpContext.Current.User.Identity.Name获取的竟然是自己的机器名字,而且MemberShip.GetUser()永远获取的都是null,我就纳闷了,不是Membership提供程序都已经配置好了么?

看看你的web.config吧,<authentication mode="Forms"/>里面的mode值是不是已经被设置为了"Windows"了,恍然大悟!哈哈,改过来吧.....

服务热线

153 8323 9821

功能和特性

价格和优惠

网站和维护

推广和优化

微信服务号