Output log using FtpWebRequest

后端 未结 2 2224
借酒劲吻你
借酒劲吻你 2020-11-21 23:54

I wonder if it\'s possible to have output log for my FTP client using FtpWebRequest.

Something like this:



        
2条回答
  •  轮回少年
    2020-11-22 00:34

    check these following links for reference. if you have IIS 7 then it is possible to implement your own functionality.

    implementing IFtpLogProvider interface's Log method

    using System;
    using System.IO;
    using Microsoft.Web.FtpServer;
    using System.Diagnostics;
    using System.Diagnostics.Eventing;
    
    namespace FtpLogging
    {
        public class FtpLogDemo : BaseProvider,
            IFtpLogProvider
        {
            void IFtpLogProvider.Log(FtpLogEntry loggingParameters)
            {
             .......
    

    Ref:
    IIS FTP 7.5 Extensibility (IFtpLogProvider and logging FTP failures to the event log)
    Problem writing to a file (C#)

提交回复
热议问题