コード例 #1
0
 /// <summary>
 /// Create the appropriate file destination for the specified settings profile and initial path
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="initialPath"></param>
 /// <returns></returns>
 public static FileDestination CreateFileDestination(WebPublishSettings settings, string initialPath)
 {
     DestinationProfile destProfile = settings.Destination.Profile;
     if (destProfile.Type == DestinationProfile.DestType.WINDOWS)
     {
         return new LocalFileSystemDestination(initialPath);
     }
     else
     {
         return new WinInetFTPFileDestination(destProfile.FtpServer, initialPath, destProfile.UserName, destProfile.Password);
     }
 }
コード例 #2
0
        /// <summary>
        /// Create the appropriate file destination for the specified settings profile and initial path
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="initialPath"></param>
        /// <returns></returns>
        public static FileDestination CreateFileDestination(WebPublishSettings settings, string initialPath)
        {
            DestinationProfile destProfile = settings.Destination.Profile;

            if (destProfile.Type == DestinationProfile.DestType.WINDOWS)
            {
                return(new LocalFileSystemDestination(initialPath));
            }
            else
            {
                return(new WinInetFTPFileDestination(destProfile.FtpServer, initialPath, destProfile.UserName, destProfile.Password));
            }
        }
コード例 #3
0
 /// <summary>
 /// Creates a destination that points to the destination's root folder.
 /// </summary>
 /// <returns></returns>
 public static FileDestination CreateRootDestination(WebPublishSettings settings)
 {
     FileDestination dest;
     if (settings.Destination.Profile.Type == DestinationProfile.DestType.FTP)
     {
         if (settings.PublishRootPath.StartsWith("/", StringComparison.OrdinalIgnoreCase))
             dest = CreateFileDestination(settings, "/");
         else
             dest = CreateFileDestination(settings, "");
     }
     else
         dest = CreateFileDestination(settings, "");
     return dest;
 }
コード例 #4
0
        /// <summary>
        /// Creates a destination that points to the destination's root folder.
        /// </summary>
        /// <returns></returns>
        public static FileDestination CreateRootDestination(WebPublishSettings settings)
        {
            FileDestination dest;

            if (settings.Destination.Profile.Type == DestinationProfile.DestType.FTP)
            {
                if (settings.PublishRootPath.StartsWith("/", StringComparison.OrdinalIgnoreCase))
                {
                    dest = CreateFileDestination(settings, "/");
                }
                else
                {
                    dest = CreateFileDestination(settings, "");
                }
            }
            else
            {
                dest = CreateFileDestination(settings, "");
            }
            return(dest);
        }