MakeRelative() public static method

public static MakeRelative ( string pathToMakeRelative, string pathToMakeRelativeTo ) : string
pathToMakeRelative string
pathToMakeRelativeTo string
return string
        public void CreateZipFile()
        {
            // Delete the file if it exists
            if (System.IO.File.Exists(mZippedTemplateFile))
            {
                System.IO.File.Delete(mZippedTemplateFile);
            }

            // Now create it
            var allFiles = FileManager.GetAllFilesInDirectory(mTemplateLocation);

            using (ZipFile zipFile = ZipFile.Create(mZippedTemplateFile))
            {
                zipFile.BeginUpdate();

                foreach (string file in allFiles)
                {
                    bool shouldSkip = file.Contains("/.svn/") ||
                                      file.Contains("/.DS_Store");

                    if (!shouldSkip)
                    {
                        string sourceFile      = file;
                        string destinationFile = FileManager.MakeRelative(file, mTemplateLocation);

                        zipFile.Add(sourceFile, destinationFile);

                        System.Console.WriteLine("Added to zip: " + destinationFile);
                    }
                }
                zipFile.CommitUpdate();
            }
        }
        public void UploadToFtp()
        {
            System.Console.WriteLine("Starting uploads...");
            string username = "******";

            string directory =
                System.IO.Path.GetDirectoryName(
                    System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "/";

            string passwordLocationFile = directory + "pw.txt";

            // chop off "file:"
            passwordLocationFile = passwordLocationFile.Substring(5);
            //string password = "******";
            string password = System.IO.File.ReadAllText(passwordLocationFile);


            bool   succeeded   = false;
            string errorString = null;

            try
            {
                FtpManager.UploadFile(mZippedTemplateFile, mRemoteZipLocation, username, password, false);
                System.Console.WriteLine("Uploaded to " + mRemoteZipLocation);

                foreach (string file in mDlls)
                {
                    string sourceFile         = mBuildDirectory + file;
                    string destinationFile    = FileManager.MakeRelative(file, mTemplateLocation);
                    string remoteFileLocation = mSingleDllLocation + FileManager.RemoveDirectory(file);



                    FtpManager.UploadFile(sourceFile, remoteFileLocation, username, password, false);
                    System.Console.WriteLine("Uploaded to " + remoteFileLocation);
                }



                succeeded = true;
            }
            catch (Exception exception)
            {
                errorString = exception.ToString();
            }

            if (succeeded)
            {
                System.Console.WriteLine("Uploads succeeded");
            }
            else
            {
                System.Console.WriteLine("Uploads failed");
                System.Console.Write(errorString);
            }
        }