简体   繁体   English

在IIS7中以编程方式为虚拟目录启用BITS上载

[英]Enable BITS Uploads for virtual directory programmatically in IIS7

In IIS7 under the feature called "BITS Uploads" for virtual directories, there is a checkbox for "Allow clients to upload files" I need to enable this checkbox for specific virtual directory and also for "Default Web Site" 在IIS7中,虚拟目录称为“BITS上传”功能,有一个“允许客户端上传文件”的复选框我需要为特定虚拟目录启用此复选框,也为“默认网站”启用此复选框

Can this be done in C# or even in a command line so I can run it throught script\\C#? 这可以在C#中完成,甚至可以在命令行中完成,这样我就可以通过脚本\\ C#来运行它吗?

Thanks! 谢谢!

Edit: After investigating the changes of applicationHost.config it is possible to modify this Xml file however with a lot of changes (including GUID changes) But it does not feel right...i hoped that appcmd.exe\\c# could supply me a solution for this small but important requirment. 编辑:在调查applicationHost.config的更改之后,可以修改这个Xml文件但是有很多更改(包括GUID更改)但是感觉不对...我希望appcmd.exe \\ c#可以为我提供一个解决这个小而重要的要求。 I will be really greatfull if someone can post a better solution for this problem Thanks, Lior 如果有人能为这个问题发布更好的解决方案,我会非常感谢谢谢,Lior

您可以根据需要使用c#或您选择的任何语言修改ApplicationHosts.config文件: http//learn.iis.net/page.aspx/373/editing-configuration-files/ (请注意,您很可能需要管理员帐户,如果启用了UAC)

I've figured a better way to configure IIS automatically. 我想到了一种更好的自动配置IIS的方法。 For IIS7 you can download an administration pack that lets you generate scripts(C#\\javascript\\appcmd) for IIS configuration. 对于IIS7,您可以下载管理包,以便为IIS配置生成脚本(C#\\ javascript \\ appcmd)。 In IIS7.5 the administration pack is already integrated as a part of the IIS and it is called "Configuration Editor" 在IIS7.5中,管理包已作为IIS的一部分集成,它被称为“配置编辑器”
You can find this on the following tutorial 您可以在以下教程中找到它

Thanks for the help you've given me before ! 感谢您之前给我的帮助!

Check out http://msdn.microsoft.com/en-us/library/microsoft.web.administration(VS.90).aspx - it's very handy when you're about to edit configs for IIS 7 and up. 查看http://msdn.microsoft.com/en-us/library/microsoft.web.administration(VS.90).aspx - 当您即将编辑IIS 7及更高版本的配置时,它非常方便。 Managed .NET library for changing IIS configuration 托管.NET库,用于更改IIS配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM