草庐IT

User_Account_Control

全部标签

c# - System.Web.HttpContext.Current.User.Identity.Name 与 ASP.NET 中的 System.Environment.UserName

System.Web.HttpContext.Current.User.Identity.Name和System.Environment.UserName在ASP.NetWeb上下文中有什么区别申请项目?这是我正在尝试做的代码:DatabasemyDB=DatabaseFactory.CreateDatabase();boolIsAuthUser=myDB.ExecuteScalar("procIsAuthorizedUser",System.Environment.UserName);如果它们在功能上相同,哪个在性能方面更好?这是一个C#4.0/ASP.Net网络应用程序,将在组织内

c# - HttpContext.Current.User.Identity.Name 使用 IIS Express 但不是 Visual Studio Development Server 为空

这个问题在这里已经有了答案:AuthenticationissuewhendebugginginVS2013-iisexpress(9个回答)关闭4年前。HttpContext.Current.User.Identity.Name在VisualStudio设置为“使用本地IISWeb服务器”时为空,但在VisualStudio设置为“使用VisualStudio开发”时正常工作服务器”。希望您可以通过执行以下操作在VisualStudio2010或2012(我都尝试过)中重现此问题:创建一个新的“ASP.NET空Web应用程序”并选择“.NETFramework4”并将其命名为“Win

c# - HttpContext.Current.User.Identity.Name 使用 IIS Express 但不是 Visual Studio Development Server 为空

这个问题在这里已经有了答案:AuthenticationissuewhendebugginginVS2013-iisexpress(9个回答)关闭4年前。HttpContext.Current.User.Identity.Name在VisualStudio设置为“使用本地IISWeb服务器”时为空,但在VisualStudio设置为“使用VisualStudio开发”时正常工作服务器”。希望您可以通过执行以下操作在VisualStudio2010或2012(我都尝试过)中重现此问题:创建一个新的“ASP.NET空Web应用程序”并选择“.NETFramework4”并将其命名为“Win

搭建微服务时 nacos2.2.2报错403 user not found!

1.错误:com.alibaba.nacos.api.exception.NacosException:failedtoreqAPI:/nacos/v1/ns/instanceafterallservers([localhost:8848])tried:ErrCode:403,ErrMsg:WhitelabelErrorPageThisapplicationhasnoexplicitmappingfor/error,soyouareseeingthisasafallback.SatJun1015:35:54GMT+08:002023Therewasanunexpectederror(type=

c# - 错误 : The Out Parameter must be assigned before control leaves the current method

发送回参数时出现此错误Error:TheOutParametermustbeassignedbeforecontrolleavesthecurrentmethod代码是publicvoidGetPapers(stringweb,outintId1,outintId2){SqlConnectionconn=newSqlConnection(ConnectionString());conn.Open();SqlCommandcmd=newSqlCommand("GetPapers",conn);cmd.CommandType=CommandType.StoredProcedure;cmd.

c# - 错误 : The Out Parameter must be assigned before control leaves the current method

发送回参数时出现此错误Error:TheOutParametermustbeassignedbeforecontrolleavesthecurrentmethod代码是publicvoidGetPapers(stringweb,outintId1,outintId2){SqlConnectionconn=newSqlConnection(ConnectionString());conn.Open();SqlCommandcmd=newSqlCommand("GetPapers",conn);cmd.CommandType=CommandType.StoredProcedure;cmd.

c# - 为什么我的抽象基 Controller 中的 User(如 User.Identity.Name)为 null?

我在问一个相关的问题,但把标题弄乱了,没人能理解。由于我现在可以更准确地提出问题,因此我决定将其重新表述为一个新问题并关闭旧问题。对此感到抱歉。所以我想做的是将数据(存储在数据库中的自定义用户昵称)传递给LoginUserControl。此登录通过Html.RenderPartial()从母版页呈现,所以我真正需要做的是确保在每次调用时都显示ViewData["UserNickname"]。但是我不想在每个Controller的每个Action中填充ViewData["UserNickname"],所以我决定使用thisapproach并创建一个抽象基础Controller来为我完成工

c# - 为什么我的抽象基 Controller 中的 User(如 User.Identity.Name)为 null?

我在问一个相关的问题,但把标题弄乱了,没人能理解。由于我现在可以更准确地提出问题,因此我决定将其重新表述为一个新问题并关闭旧问题。对此感到抱歉。所以我想做的是将数据(存储在数据库中的自定义用户昵称)传递给LoginUserControl。此登录通过Html.RenderPartial()从母版页呈现,所以我真正需要做的是确保在每次调用时都显示ViewData["UserNickname"]。但是我不想在每个Controller的每个Action中填充ViewData["UserNickname"],所以我决定使用thisapproach并创建一个抽象基础Controller来为我完成工

数据库初始化设置密码时报错"SET PASSWORD has no significance for user 'root'@'localhost' as the authentication met...

1、报错示例Re-enternewpassword:...Failed!Error:SETPASSWORDhasnosignificanceforuser'root'@'localhost'astheauthenticationmethoduseddoesn'tstoreauthenticationdataintheMySQLserver.PleaseconsiderusingALTERUSERinsteadifyouwanttochangeauthenticationparameters.2、去手动配置密码root@LNMP:~#mysqlmysql>ALTERUSER'root'@'loc

前端异常:Bad control character in string literal in JSON at position xxx

场景:springmvc前端向后端传递json字符串,后端返回后前端解析异常异常原因:json内含有空格或换行符,可以在后端或者前端处理后再转换成json。我这里是在前端处理的:\r和\n一个回车符一个换行符,可以自行百度区别。vartotalData=JSON.parse(str.replace(/\r|\n/g,''));