怎样用C#编程来获取FTP服务器上的文件修改日期 !?modtime file-name:显示远程主机文件的最后修改时间;这是资料上写的。
那么具体怎么写呢?

解决方案 »

  1.   

    Call API:
    you can get what you want from the struct object named "FileData".
      

  2.   

    Details:
    http://www.codeproject.com/csharp/c__ftp_client.asp
      

  3.   

    这段代码应该有用:
    public DateTime getFileDate(string fileName) 
    { if (!logined) 

    login(); 

    sendCommand("MDTM " + fileName); 
    DateTime chgdate = DateTime.Now; if (retValue == 213) 

    chgdate = DateTime.Parse(reply.Substring(4)); 

    else 

    throw new IOException(reply.Substring(4)); 
    } return chgdate; }