草庐IT

user_config

全部标签

c# - Web.Config,system.serviceModel 的外部文件

使用VS2010我的web.config中有以下内容(已删除详细信息)。我想使用与appSettings相同的属性configSource从另一个配置文件中获取这些元素的详细信息。我已尝试将configSource属性应用于system.serviceModel或每个子节点。但是,我收到无效的蓝色波浪线:The'configSource'attributeisnotallowed我引用了这个问题中的第二个答案(TomBrothers的回答),它证明了我想要什么。Canaweb.configreadfromanexternalxmlfile?额外这是该帖子的配置。具有无效的蓝色波浪线。在

c# - http.context.user 和 thread.currentprincipal 之间的区别以及何时使用它们?

我最近遇到了在visualstudio2008下运行asp.netweb应用程序的问题。我收到错误“typeisnotresolvedformember...customUserPrincipal”。追踪各种讨论组发现,当您针对Thread.CurrentPrincipal分配自定义主体时,VisualStudio的Web服务器似乎存在问题。在我的代码中,我现在使用...HttpContext.Current.User=myCustomPrincipal//Thread.CurrentPrincipal=myCustomPrincipal我很高兴我排除了错误,但它回避了“这两种设置委托

c# - http.context.user 和 thread.currentprincipal 之间的区别以及何时使用它们?

我最近遇到了在visualstudio2008下运行asp.netweb应用程序的问题。我收到错误“typeisnotresolvedformember...customUserPrincipal”。追踪各种讨论组发现,当您针对Thread.CurrentPrincipal分配自定义主体时,VisualStudio的Web服务器似乎存在问题。在我的代码中,我现在使用...HttpContext.Current.User=myCustomPrincipal//Thread.CurrentPrincipal=myCustomPrincipal我很高兴我排除了错误,但它回避了“这两种设置委托

c# - 如何将 user.config 保存到 AppData\Roaming 文件夹而不是 AppData\Local?

介绍性示例这段代码Properties.Settings.Default.MyUserSettingBlah="somenewvalue";Properties.Settings.Default.Save();将user.config文件保存到C:\Users\MyUserName\AppData\Local\My_Company_Name\MyApp_Url_vb2s5kwidefdmxstmabckatcyl5t0lxd\1.0.0.0\user.config问题如何将user.config保存到C:\Users\MyUserName\AppData\漫游\...代替C:\User

c# - 如何将 user.config 保存到 AppData\Roaming 文件夹而不是 AppData\Local?

介绍性示例这段代码Properties.Settings.Default.MyUserSettingBlah="somenewvalue";Properties.Settings.Default.Save();将user.config文件保存到C:\Users\MyUserName\AppData\Local\My_Company_Name\MyApp_Url_vb2s5kwidefdmxstmabckatcyl5t0lxd\1.0.0.0\user.config问题如何将user.config保存到C:\Users\MyUserName\AppData\漫游\...代替C:\User

c# - 嵌套配置部分 app.config

我没有找到任何有关如何在app.config中访问此类嵌套配置部分的示例我之前用过ConfigurationElementCollection和ConfigurationElement。但我不知道如何执行上述操作? 最佳答案 你需要:将my.configuration定义为组,将emailNotification定义为组中的一个部分。在配置文件中添加以下内容:实现配置部分组(my.configuration)。publicclassMyConfigurationGroup:ConfigurationSectionGroup{[Con

c# - 嵌套配置部分 app.config

我没有找到任何有关如何在app.config中访问此类嵌套配置部分的示例我之前用过ConfigurationElementCollection和ConfigurationElement。但我不知道如何执行上述操作? 最佳答案 你需要:将my.configuration定义为组,将emailNotification定义为组中的一个部分。在配置文件中添加以下内容:实现配置部分组(my.configuration)。publicclassMyConfigurationGroup:ConfigurationSectionGroup{[Con

c# - 如何转换这个 web.config 部分?

我的邮件配置如下:这是我的.Release版本:如何删除所以它根本没有显示在我的.Release中?另外,我想完全删除其他namespace,例如System.Diagnostics。这样做的语法是什么? 最佳答案 对于specifiedPickupDirectory这应该有效的元素:.对于系统诊断: 关于c#-如何转换这个web.config部分?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/q

c# - 如何转换这个 web.config 部分?

我的邮件配置如下:这是我的.Release版本:如何删除所以它根本没有显示在我的.Release中?另外,我想完全删除其他namespace,例如System.Diagnostics。这样做的语法是什么? 最佳答案 对于specifiedPickupDirectory这应该有效的元素:.对于系统诊断: 关于c#-如何转换这个web.config部分?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/q

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网络应用程序,将在组织内