有人熟悉IIS中的FTP 7.5可扩展性知道我可能做错了什么吗?

我很难实现IftplogProvider的实现,无法正常工作以进行自定义记录。我要做的就是将故障的登录失败超出事件日志的静态阈值,并且每隔一段时间都有垃圾收集。我已经尝试使用通用词典和没有运气的提供商,现在即使是我无法使用的简单代码。提供商甚至没有在下面的代码存根中创建事件日志(或者如果我事先创建它)。所以现在我深感困惑。

我按照指示在VS内签名后注册它的说明,我可以确认将其添加到GAC中。通过注册自定义提供商选项将其添加到IIS 7.5似乎也很好。

对特定建议的任何帮助将不胜感激,因为即使有Robert Mcmurray的出色教程,我仍然遇到这些问题。顺便说一下,我使用托管代码的接口在2008 R2框上运行此操作。

存根以下:

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration.Provider;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.Eventing;
using System.Text;
using Microsoft.Web.FtpServer;
using System.IO;

public class test: BaseProvider, IFtpLogProvider
{

    void IFtpLogProvider.Log(FtpLogEntry loggingParameters)
    {
        if (!EventLog.SourceExists("TEST"))
        {
            EventLog.CreateEventSource("TEST", "TEST");
        }

        // Just trying to get anything into this log, like a list of
        // USER attempts or something
        EventLog.WriteEntry("TEST", loggingParameters.Command);

    }

    // Mark an IP address for banning.
    private void BanAddress(string ipAddress)
    {
        EventLog.WriteEntry("TEST", ipAddress, EventLogEntryType.Warning, 9010);
    }
}
有帮助吗?

解决方案

我有以下问题:

1) 我在IIS中对此大会的注册中有一个不正确的班级名称:

ftplogging.ftplogdemo,ftploggingDemo,版本= 1.0.0.0,文化=中性,publicKeytoken =

2) 我没有 密切 注册大会时,请遵循罗伯特的建议。我离开了检查复选框,这将其保留为身份验证提供商,该代码示例不是。相反,我启用了基本验证验证,禁用匿名auth(就我而言),然后 未选中 教程中提到的框 - “在提供者列表中清除ftploggingDemo复选框”。

3) 我没有使用appCMD(或直接在applicationhost.config中修改适当的部分)来更新applicationhost.config中的“自定义提供者”部分

<customFeatures>
    <providers>
        <add name="FtpLoggingDemo" enabled="true" />
    </providers>
</customFeatures>

做这三件事解决了问题。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top