Beispiel #1
0
        private static Uri ParseTableQueryAndVerify(Uri address, out StorageCredentials parsedCredentials)
        {
            parsedCredentials = null;
            if (address == null)
            {
                return(null);
            }
            if (!address.IsAbsoluteUri)
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Address '{0}' is a relative address. Only absolute addresses are permitted.", new object[1]
                {
                    address.ToString()
                }), "address");
            }
            IDictionary <string, string> queryParameters = HttpWebUtility.ParseQueryString(address.Query);

            parsedCredentials = SharedAccessSignatureHelper.ParseQuery(queryParameters);
            return(new Uri(address.GetComponents(UriComponents.Scheme | UriComponents.Host | UriComponents.Port | UriComponents.Path, UriFormat.UriEscaped)));
        }
 public SasQueryBuilder(string sasToken)
 {
     AddRange(HttpWebUtility.ParseQueryString(sasToken));
 }