小编Bra*_*fur的帖子

加密web.config的自定义部分

我使用文章创建灵活配置节处理程序在我的应用程序中创建灵活配置节处理程序.

我还在OdeToCode博客上看到了题为加密自定义配置部分的文章,介绍了如何加密web.config文件的各个部分.

从第一篇文章中,我们有了这个web.config代码.

<?xmlversion="1.0"encoding="utf-8"?>
<configuration>
    <configSections>
        <sectionname="StyleSheetSettings_1"    
            type="FifteenSeconds.Core.BasicConfigurator"/>
    </configSections>
    <StyleSheetSettings_1>
        <StyleSheets>
            <Style SheetName="Page"Href="Styles/Page.css"Media="screen"/>
            <StyleSheetName="Custom"Href="Styles/Custom.css"Media="screen"/>
            <StyleSheetName="Print"Href="/Lib/Styles/Print.css"Media="print"/>
        </StyleSheets>      
    </StyleSheetSettings_1>
 </configuration>
Run Code Online (Sandbox Code Playgroud)

我尝试使用以下代码使用类似以下命令行代码的方式加密代码.

 aspnet_regiis.exe -pef  "StyleSheetSettings_1" C:\Test\
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

不能"从组件 '的System.Web,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a' 加载类型FifteenSeconds.Core.BasicConfigurator.

任何帮助,将不胜感激.

asp.net configuration web-config

12
推荐指数
3
解决办法
5668
查看次数

无法从[服务器]下载[文件]无法打开此Internet站点.请求的网站不可用

我使用以下asp.net代码来传输word文档.

     Response.Clear();
     Response.ContentType = "application/vnd.ms-word";
     Response.AddHeader("content-disposition", "attachment;filename=\"" + Letter.WordFileName.Replace(" ", "%20").Replace("&", "And") + "\"");
     Response.BinaryWrite(Letter.WordDocument.ToMSWordDocument());
     Response.End();
Run Code Online (Sandbox Code Playgroud)

上周,我尝试在ie8中传输文件时开始收到以下消息

无法从[服务器]下载[文件]

无法打开此Internet站点.请求的站点不可用或无法找到.请稍后再试.

更新到ie9后我没有收到错误,但我的大多数用户仍然使用ie8.我觉得这可能与Windows安全补丁有关,但我从谷歌搜索中找不到这样的东西.

以下是一些更多信息:

  • 该错误仅发生在ie8中
  • 我没有使用https来显示word文档
  • 这个问题上周开始发生了.
  • 在未更新3周的系统上存在错误.
  • 我使用ie8在多台计算机上遇到此问题.

响应标题

HTTP/1.1 200 OK Cache-Control:private,no-cache ="Set-Cookie"Content-Type:application/vnd.ms-word服务器:Microsoft-IIS/7.5 Set-Cookie:.ASPXAUTH =; path =/content-disposition:attachment; filename ="Septa%20Roberts%20Compound%2020111226 [1] .doc"X-AspNet-Version:4.0.30319 X-Powered-By:ASP.NET Date:Tue,2012年1月10日16:07:51 GMT内容 - 长度:147456

asp.net streaming internet-explorer-8

8
推荐指数
1
解决办法
7403
查看次数