iis下载失败(IIS7,网站目录下的exe文件,无法下载,提示404错误,求解!)

本文目录
IIS7,网站目录下的exe文件,无法下载,提示404错误,求解!
兄弟,我刚刚也是被这个问题困扰了,后来被我试出来了,我的.7z文件不能下载,然后我尝试在站点里面管理页面的功能视图中找到MIME类型,然后在里面添加上.7z的相关信息
扩展名.7z MIME类型application/x-7z-compressed 然后重启站点就可以正常下载了
急!!!asp.net做的文件下载,放到IIS下载不了
修改项中的web.config//下载目录相对路径
《add key="UploadPath" value="/Security/Uploads" /》
//下载目录虚拟路径
***隐藏网址***
//windows用户名
《add key="BasicAuthenticationUser" value="administrator" /》
//windows用户密码
《add key="BasicAuthenticationPWD" value="admin$123" /》
3、下载程序源码
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Net;
using System.IO;
namespace security
{
/// 《SUMMARY》
/// 《/SUMMARY》
public class SecureFile
{
public SecureFile()
{
}
public bool UploadFile(HtmlInputFile inputfile)
{
try
{
string fileName = "";
string DirPath = "";
if(( inputfile.PostedFile != null ) &&
( inputfile.PostedFile.ContentLength 》 0 ))
{
DirPath=HttpContext.Current.Server.MapPath(
System.Configuration.ConfigurationSettings.AppSettings[
"UploadPath"]);
fileName = System.IO.Path.GetFileName(
inputfile.PostedFile.FileName );
inputfile.PostedFile.SaveAs( DirPath "\\\" fileName );
}
return true;
}
catch
{
return false;
}
}
public bool DownloadFile(string strFile)
{
try
{
string strDownloadURL=
System.Configuration.ConfigurationSettings.AppSettings[
"DownloadURL"];
string strUser=
System.Configuration.ConfigurationSettings.AppSettings[
"BasicAuthenticationUser"];
string strPWD=
System.Configuration.ConfigurationSettings.AppSettings[
"BasicAuthenticationPWD"];
string strURL=strDownloadURL "\\\" strFile;
WebClient req=new WebClient();
CredentialCache mycache=new CredentialCache();
mycache.Add(new Uri(strURL),"Basic",
new NetworkCredential(strUser,strPWD));
req.Credentials=mycache;
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();
response.Buffer= true;
response.AddHeader("Content-Disposition",
"attachment;filename=\"" strFile "\"");
byte data=req.DownloadData(strURL);
response.BinaryWrite(data);
response.End();
return true;
}
catch(Exception ex)
{
if(ex.Message=="The remote server "
"returned an error: (404) Not Found.")
throw new Exception("File not found");
else if(ex.Message=="The remote server"
" returned an error: (401) Unauthorized.")
throw new Exception("Unauthorized access");
return false;
}
}
}
}
win10系统安装iis失败出现0x80073701错误代码如何解决
最近小编逛某论坛的时候,发现有win10系统用户在咨询说在【windows添加/关闭功能】中选择了IIS相关的功能,但是安装后却失败了,出现0x80073701错误代码,遇到这样的问题该怎么办呢,现在随小编一起来看看win10系统安装iis失败出现0x80073701错误代码的具体解决方法。
1、首先打开Windows命令提示符。若要打开命令提示符下,单击开始菜单运行。复制和粘贴(或类型)下面的命令,然后按回车键:
cmd
2、停止BITS服务和Windows更新服务。若要执行此操作,请在命令提示符处键入以下命令。键入每个命令后按回车键。
netstopbits
netstopwuauserv
3、删除qmgr\.dat文件。若要执行此操作,在命令提示符下键入以下命令,然后按回车键:
Del%ALLUSERSPROFILE%\ApplicationData\Microsoft\Network\Downloader\qmgr.dat
4、如果这是你第一次通过使用本文中的步骤来解决Windows更新问题尝试,转到步骤5而不执行步骤4中的步骤。仅应在此点中的疑难解答,如果你无法解决但第4步的所有步骤后的Windows更新问题执行在步骤4中的步骤。步骤4中的步骤也将通过修复主动模式来执行它上述解决方案。
a.重命名为以下文件夹。BAK:
%systemroot%\SoftwareDistribution\DataStore
%systemroot%\SoftwareDistribution\Download
%systemroot%\system32\catroot2
若要执行此操作,请在命令提示符处键入以下命令。键入每个命令后按回车键。
Ren%systemroot%\SoftwareDistribution\DataStore.bak
Ren%systemroot%\SoftwareDistribution\Download.bak
Ren%systemroot%\system32\catroot2.bak
b.BITS服务和Windows更新服务重置为默认安全描述符。若要执行此操作,请在命令提示符处键入以下命令。键入每个命令后按回车键。
sc.exesdset位d:(一个;CCLCSWRPWPDTLOCRRC;;SY)(一个;CCDCLCSWRPWPDTLOCRSDRCWDWO;;栏)(一个;CCLCSWLOCRRC;;AU)(一个;CCLCSWRPWPDTLOCRRC;;PU)
sc.exesdsetwuauservd:(一个;CCLCSWRPWPDTLOCRRC;;SY)(一个;CCDCLCSWRPWPDTLOCRSDRCWDWO;;栏)(一个;CCLCSWLOCRRC;;AU)(一个;CCLCSWRPWPDTLOCRRC;;PU)
5、在命令提示符下键入以下命令,然后按回车键:
cd/d%windir%\system32
6、重新注册位文件和Windows更新文件。若要执行此操作,请在命令提示符处键入以下命令。键入每个命令后按回车键。
regsvr32.exeatl.dll
regsvr32.exeurlmon.dll
regsvr32.exemshtml.dll
regsvr32.exeshdocvw.dll
regsvr32.exebrowseui.dll
regsvr32.exejscript.dll
regsvr32.exevbscript.dll
regsvr32.exescrrun.dll
regsvr32.exemsxml.dll
regsvr32.exemsxml3.dll
regsvr32.exemsxml6.dll
regsvr32.exeactxprxy.dll
regsvr32.exesoftpub.dll
regsvr32.exewintrust.dll
regsvr32.exedssenh.dll
regsvr32.exersaenh.dll
regsvr32.exegpkcsp.dll
regsvr32.exesccbase.dll
regsvr32.exeslbcsp.dll
regsvr32.execryptdlg.dll
regsvr32.exeoleaut32.dll
regsvr32.exeole32.dll
regsvr32.exeshell32.dll
regsvr32.exeinitpki.dll
regsvr32.exewuapi.dll
regsvr32.exewuaueng.dll
regsvr32.exewuaueng1.dll
regsvr32.exewucltui.dll
regsvr32.exewups.dll
regsvr32.exewups2.dll
regsvr32.exewuweb.dll
regsvr32.exeqmgr.dll
regsvr32.exeqmgrprxy.dll
regsvr32.exewucltux.dll
regsvr32.exemuweb.dll
regsvr32.exewuwebv.dll
7、重置Winsock。若要执行此操作,在命令提示符下键入以下命令,然后按回车键:
netshresetwinsock
8、如果你运行的WindowsXP或WindowsServer2003,你必须设置代理设置。若要执行此操作,在命令提示符下键入以下命令,然后按回车键:
proxycfg.exe-d
9、重启BITS服务和Windows更新服务。若要执行此操作,请在命令提示符处键入以下命令。键入每个命令后按回车键。
netstartbits
netstartwuauserv
10、如果你运行的WindowsVista或WindowsServer2008,请清除位队列。若要执行此操作,在命令提示符下键入以下命令,然后按回车键:
bitsadmin.exe/reset/allusers
经过上面的方法就可以解决win10系统安装iis失败出现0x80073701错误代码这个情况了,大家不妨可以参考上面的步骤来解决。

更多文章:
未来三天天气预报(黄冈天气预报黄冈天气预报30天准确一个月)
2026年10月8日 22:20
三星安卓4 0(三星手机安卓版本4.0.4玩王者荣耀卡怎么办)
2025年7月7日 19:15
visio 2007密钥(求Microsoft Office Visio 2007 中文版的产品密钥)
2025年5月23日 11:30
isee图片处理(frontpage和iSee哪个是图形图像处理软件)
2026年4月25日 15:30
steam错误代码118怎么解决(steam网络错误118怎么处理)
2025年11月19日 16:45
美图秀秀电脑版官方下载安装(美图秀秀电脑版官方下载安装免费)
2025年6月2日 11:52



















