1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111《ASP.NET办公自动化系统开发实例导航》一书经常遇到这样的错误,有什么方法解决吗?
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
“/Webs”应用程序中的服务器错误。
--------------------------------------------------------------------------------安全性异常
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。 异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。源错误:
行 261: if (!EventLog.SourceExists("hotop100"))
行 262: {
行 263: EventLog.CreateEventSource("hotop100", "Application");
行 264: }
行 265: //将错误日志信息写入Windows事件日志中
源文件: F:\qminoa\Webs\PageBase.cs 行: 263 堆栈跟踪:
[SecurityException: 不允许所请求的注册表访问权。]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName)
qminoa.Webs.PageBase.LogEvent(String message, EventLogEntryType entryType) in F:\qminoa\Webs\PageBase.cs:263
qminoa.Webs.PageBase.PageBase_Error(Object sender, EventArgs e) in F:\qminoa\Webs\PageBase.cs:286
System.Web.UI.TemplateControl.OnError(EventArgs e)
System.Web.UI.Page.HandleError(Exception e)
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
我在网站的后台(manage文件夹)想使用身份验证,如果没有登陆则自动转到login.aspx,可是对与前台的页面也自动转到该页面了,如何只有在访问后台页面时才被导航至login.aspx页面.
在web.config中我是这么写的 <authentication mode="Forms">
<forms loginUrl="Login.aspx" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
“/Webs”应用程序中的服务器错误。
--------------------------------------------------------------------------------安全性异常
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。 异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。源错误:
行 261: if (!EventLog.SourceExists("hotop100"))
行 262: {
行 263: EventLog.CreateEventSource("hotop100", "Application");
行 264: }
行 265: //将错误日志信息写入Windows事件日志中
源文件: F:\qminoa\Webs\PageBase.cs 行: 263 堆栈跟踪:
[SecurityException: 不允许所请求的注册表访问权。]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName)
qminoa.Webs.PageBase.LogEvent(String message, EventLogEntryType entryType) in F:\qminoa\Webs\PageBase.cs:263
qminoa.Webs.PageBase.PageBase_Error(Object sender, EventArgs e) in F:\qminoa\Webs\PageBase.cs:286
System.Web.UI.TemplateControl.OnError(EventArgs e)
System.Web.UI.Page.HandleError(Exception e)
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
我在网站的后台(manage文件夹)想使用身份验证,如果没有登陆则自动转到login.aspx,可是对与前台的页面也自动转到该页面了,如何只有在访问后台页面时才被导航至login.aspx页面.
在web.config中我是这么写的 <authentication mode="Forms">
<forms loginUrl="Login.aspx" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
解决方案 »
- 见笑见笑 一个返回值的问题
- 菜鸟咨询MENU控件跳转页面的问题
- 为什么LinkButton会出现这样的情况?
- visible属性:为什么超链接还是显示?
- 请求帮忙!关于省市县联动WEB控件的问题?
- 请问:dropdownlist的datatextfield怎样绑定或能否多个字段的值?
- 如何实现鼠标双击DataGrid的一行,使该行成为编辑状态
- 关于上传文件
- 高手推荐几本C#语言的ASP.net web编程的书籍
- ASP。NET能否通过控件实现节点效果
- 在sqlserver 中有没有 象oracle 中rowid 标识第几行的关键字
- 选择开始日期和结束日期,用dataGrid显示每天记录,要求一个DataGrid对应一天,有高人能解决吗?
<deny users="?" />
</authorization>
这个Web.config是要放在Manage文件夹下的,另外在程序根目录下放一个Login.aspx,里面放Login控件即可
<?xml version="1.0" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings />
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
--------------------------
不用加<authentication mode="Forms">了,因为你的根目录中的那个Web.config文件有了
Web.config中的<system.web></system.web>里要加上<identity impersonate="true" userName="Administrator" password="longon your system password"></identity>
不过这样不太安全
2.
要登录才可访问的页面放在一文件夹里,该文件夹里的web.config中写 <authentication mode="Forms">
<forms loginUrl="Login.aspx" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
不要的就不要放于该文件夹下
哈哈,谢谢!不过听你的语气,好像不太确定。
按照我前面说的方法就可以,你试一试不就可以了啦
哈哈,谢谢!不过听你的语气,好像不太确定。
虽然不确定,但是是正确的
小弟先谢谢了
[email protected]
小弟先谢谢了[email protected]