如何伪造IIS中的目录列表? VirtualPathProvider适用于文件但是 [英] How to fake a directory listing in IIS? VirtualPathProvider works for file but

查看:154
本文介绍了如何伪造IIS中的目录列表? VirtualPathProvider适用于文件但是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用AppFabric 1.1& IIS 8.0运行基于xamlx的工作流程。为了使静态xamlx文件消失,我们使用Ron Jacobs完美的示例代码将它们存储在数据库中,并通过 VirtualPathProvider 提供xamlx内容。

We're using AppFabric 1.1 & IIS 8.0 to run our xamlx based workflows. To make the static xamlx files go away we're used Ron Jacobs perfect sample code to store them in a database and serve the xamlx content trough a VirtualPathProvider.

http://blogs.msdn.com/b/rjacobs/archive/2011/06/15/how-to-load-wf4-workflow -services-from-a-database-with-iis-appfabric.aspx

到目前为止,如果有人点击右边的话,xamlx文件会被提供uri。

So far so good, the xamlx files are served if someone hits the right uri.

但现在AppFabric Dashboard没有机会收集和登记xamlx文件作为服务,因为它们不再对AppFabric可见。

But now the AppFabric Dashboard has no chance to collect and enlist the xamlx files as services because they're not visible to AppFabric anymore.

目标必须是伪造目录列表并从db读取所有xamlx工作流名称。

The goal must be to fake a directory listing and reading all xamlx workflow names from db.

我试图通过以这种方式覆盖基于目录的方法来扩展 VirtualPathProvider

I've tried to do that by extending the VirtualPathProvider by overriding the Directory based methods this way

    public override bool DirectoryExists(string virtualDir)
    {
        return base.DirectoryExists(virtualDir);
    }

    public override VirtualDirectory GetDirectory(string virtualDir)
    {
        if (IsPathVirtual(virtualDir))
        {
            return new VirtualDirectoryDecorator(base.GetDirectory(virtualDir));
        }
        else
        {
            return Previous.GetDirectory(virtualDir);
        }

    }

但这些方法不会被调用我已经猜到了。这是因为Uri没有扩展名,而asp.net也没有被调用。

But these methods are not invoked the way I have guessed. It's because the Uri has no extension and asp.net does not get called.

任何帮助都可以使这个假目录列表发生!

Any help appreciated to make this fake directory listing happen!

谢谢

推荐答案

您需要修改 web.config 文件指示IIS必须为每个请求调用ASP.NET,这是通过< modules runAllManagedModulesForAllRequests =true/> 属性完成的。您的应用程序根目录。

You need to modify your web.config file to instruct IIS that ASP.NET must be invoked for every request, this is done with the <modules runAllManagedModulesForAllRequests="true" /> attribute in your application root.

我认为您应该重命名您的问题,因为乍一看我以为您在内部使用VirtualPathProvider并希望隐藏IIS的自动生成的目录内容列表页面。

I think you should rename your Question, because at first glance I thought you were using VirtualPathProvider internally and wanted to hide IIS's auto-generated directory contents listings pages.

这篇关于如何伪造IIS中的目录列表? VirtualPathProvider适用于文件但是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆