示例#1
0
 private static extern bool DoFtpGetFile(SafeInternetHandle hConnect, string lpszRemoteFile, string lpszNewFile, [MarshalAs(UnmanagedType.Bool)] bool fFailIfExists, uint dwFlagsAndAttributes, FtpHandle.GetFileFlags dwFlags, IntPtr dwContext);
示例#2
0
 /// <summary>
 /// Invokes <c>FtpGetFile</c>, handling error conditions.
 /// </summary>
 /// <param name="connect">The connected internet handle.</param>
 /// <param name="remoteFile">The remote file to download.</param>
 /// <param name="localFile">The local path and filename to which to save the file.</param>
 /// <param name="failIfExists">Whether to fail if the local file specified by <paramref name="localFile"/> already exists.</param>
 /// <param name="flags">Additional flags for this action. At least <see cref="FtpHandle.GetFileFlags.Ascii"/> or <see cref="FtpHandle.GetFileFlags.Binary"/> should be specified.</param>
 public static void FtpGetFile(SafeInternetHandle connect, string remoteFile, string localFile, bool failIfExists, FtpHandle.GetFileFlags flags)
 {
     if (!DoFtpGetFile(connect, remoteFile, localFile, failIfExists, 0, flags, (IntPtr)1))
     {
         throw GetLastInternetException();
     }
 }