Ejemplo n.º 1
0
 private static extern bool DoFtpPutFile(SafeInternetHandle hConnect, string lpszLocalFile, string lpszNewRemoteFile, FtpHandle.PutFileFlags dwFlags, IntPtr dwContext);
Ejemplo n.º 2
0
 /// <summary>
 /// Invokes <c>FtpPutFile</c>, handling error conditions.
 /// </summary>
 /// <param name="connect">The connected internet handle.</param>
 /// <param name="localFile">The local file to upload.</param>
 /// <param name="remoteFile">The remote path and filename to which to save the file.</param>
 /// <param name="flags">Additional flags for this action. At least <see cref="FtpHandle.PutFileFlags.Ascii"/> or <see cref="FtpHandle.PutFileFlags.Binary"/> should be specified.</param>
 public static void FtpPutFile(SafeInternetHandle connect, string localFile, string remoteFile, FtpHandle.PutFileFlags flags)
 {
     if (!DoFtpPutFile(connect, localFile, remoteFile, flags, (IntPtr)1))
     {
         throw GetLastInternetException();
     }
 }