本来想利用 serv-U 的数据库功能来实现的,结果发现它的数据库里没有关于在线人数的信息,郁闷~
有什么方法能让我的程序知道当前有多少用户在连我的 ftp 呢?我的程序是 c# 的

解决方案 »

  1.   

    关注下
    或许我也用的上。====CSDN 小助手 V2.5 ====
    CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
    速度快;使用方便;提供源代码。
    界面:http://blog.csdn.net/Qqwwee_Com/category/146601.aspx
    下载:http://szlawbook.com/csdnv2
      

  2.   

    你可以下个ftp程序的源代码来看看,有方法的。
      

  3.   

    Serv-U有啊,帮助里面就有讲这些东西,正在连接的,已连接上的,等等,很多系统变量的,怎么用我忘了,我回家再查下帮助
      

  4.   

    Serv-U FTP Server can display various types of messages:
    ?Sign-on/sign-off messages ?User specific login messages ?Directory change messages There are several symbolic parameters that can be entered in the message text. These parameters are expanded while being sent to a client. They all begin with '%'. Here is the complete list:Time/date%Time - displays the current time on your PC
    %Date - displays the current date on your PCServer statistics%ServerDays - displays the number of days the server has been running
    %ServerHours - displays the number of hours the server has been running
    %ServerMins - displays the number of minutes the server has been up
    %ServerSecs - displays the number of seconds the server has been up
    %ServerKbUp - displays the no. Kbytes uploaded to the server since server start
    %ServerKbDown - displays the no. Kb downloaded from the server since server start
    %ServerFilesUp - displays the no. of files uploaded to the server since server start%ServerFilesDown - displays the no. of files downloaded from the server since server start
    %LoggedInAll - displays total no. of logged in users since server start
    %ServerAvg - displays the average server throughput since server start
    %ServerKBps - displays current server bandwidth useServer settings%MaxUsers - displays the maximum no. of users, as set in 'Settings - Domain'
    %MaxAnonymous - the maximum no. of anonymous users, as set in 'Settings - Domain'User info%Name - displays the user's login name
    %IP - displays the user's IP number or name if available
    %Dir - displays the user's current directory
    %Disk - displays the user's current disk drive
    %DFree - displays the amount of free space on the user's current disk in Mb
    %FUp - displays the number of files uploaded by the current user
    %FDown - displays the number of files downloaded
    %FTot - displays the total number of files transferred
    %BUp - displays the number of Kbytes uploaded by the user%Bdown - displays the number of Kbytes downloaded by the user
    %BTot - displays the total number of Kbytes transferred
    %TconM - displays the total connect time in minutes
    %TconS - displays the connect time in seconds - to be used with '%tconm'
    %RatioUp - displays the 'upload' ratio part for UL/DL ratios
    %RatioDown - displays the 'download' ratio part for UL/DL ratios
    %RatioCredit - displays the current download credit for UL/DL ratios (Kb or 'files')
    %QuotaUsed - displays how much disk quota is used in Kb%QuotaLeft - displays how much disk quota is left in Kb
    %QuotaMax - displays the maximum amount of disk space that can be used in KbNumber of users%UNow - displays the current number of Serv-U users connected
    %UAll - displays the number of users since the server was started
    %U24h - displays the number of users in the last 24 hours
    %UAnonAll - all currently logged in anonymous users
    %UAnonThisIP  - all anonymous users logged into this IP home
    %UNonAnonAll  - all non-anonymous users currently logged in
    %UNonAnonThisIP - all non-anonymous users logged into this IP home
    %UThisName - all current users with the current user name logged into this IP homeThe file upload and download message directives are for the current session only (i.e. they do not show the aggregate over multiple sessions).The '%ServerDays', '%ServerHours', '%ServerMins', and '%ServerSecs' directives are meant for use together. The number of hours is what's left after the number of days is subtracted, and the same goes for the number of minutes and seconds.Example Message:Welcome to ftp.cat-soft.com, home of Serv-U!
    Local time is %time, and %u24h users have visited over the last 24 hours. This server has been up for %ServerDays days, %ServerHours hours, %ServerMins min. and %ServerSecs sec.Server stats:
        Users logged in: %loggedInAll total
          Current users: %Unow
          Kb downloaded: %ServerKbDown Kb 
            Kb uploaded: %ServerKbUp Kb
       Files downloaded: %ServerFilesDown 
         Files uploaded: %ServerFilesUp
      Average througput: %ServerAvg Kb/sec
      Current througput: %ServerKBps Kb/secKeep in mind that the average client has only 80 characters per line, and the first four are taken up by the reply code. Be brief, 70 characters should generally be considered a safe maximum.
      

  5.   

    连接后取Serv-U的返回信息啊,这个信息要你配置才会有这些信息返回的。
    Example Message是Serv-U给的例子
      

  6.   

    找到了,有在线人数这个参数,是%UNow
      

  7.   

    我只能告诉你我的想法了,自己定义一个信息格式,为你的程序开一个用户,连接到Serv-U去取数据,这个对象应该是全局对象,且只有一个(性能考虑),需要的时候去连服务器获取自定义信息,再解析出自己需要的信息来。这应该是最容易实现的(利用我已有的知识),如果你有更好的办法,也行啊