Beispiel #1
0
    /// <summary>
    /// Upload tap tin strFile tai may tram len FTP server
    /// Tham so:
    ///  strFile: ten file muon upload
    /// Tra ve:
    ///  true: thanh cong
    ///  false: that bai
    /// </summary>
    public bool UploadFile(String strFile)
    {
        IntPtr t = CWinINet.FtpOpenFile(m_HConnect, strFile, CWinINet.GENERIC_READ, CWinINet.FTP_TRANSFER_TYPE_BINARY, 0);

        if (t.ToPointer() != null)
        {
            CWinINet.InternetCloseHandle(t);
            return(false);
        }
        return(CWinINet.FtpPutFile(m_HConnect, strFile, strFile,
                                   CWinINet.FTP_TRANSFER_TYPE_BINARY, 0));
    }