コード例 #1
0
        /// <summary>
        /// Gets the canonical name of the file, formatted as file/&lt;account-name&gt;/&lt;share-name&gt;/&lt;directory-name&gt;/&lt;file-name&gt;.
        /// <para>This is used by both Shared Access and Copy operations.</para>
        /// </summary>
        /// <returns>The canonical name of the file.</returns>
        private string GetCanonicalName()
        {
            string accountName = this.ServiceClient.Credentials.AccountName;
            string shareName   = this.Share.Name;

            // Replace \ with / for uri compatibility when running under .net 4.5.
            string fileAndDirectoryName = NavigationHelper.GetFileAndDirectoryName(this.Uri, this.ServiceClient.UsePathStyleUris).Replace('\\', '/');

            return(string.Format(CultureInfo.InvariantCulture, "/{0}/{1}/{2}/{3}", SR.File, accountName, shareName, fileAndDirectoryName));
        }