Exemplo n.º 1
0
        internal PolicyStatement CalculatePolicy(Url url)
        {
            URLString uRLString = url.GetURLString();

            if (string.Compare(uRLString.Scheme, "file", StringComparison.OrdinalIgnoreCase) != 0)
            {
                return(null);
            }
            string        directoryName = uRLString.GetDirectoryName();
            PermissionSet permSet       = new PermissionSet(PermissionState.None);

            permSet.SetPermission(new FileIOPermission(this.m_access, Path.GetFullPath(directoryName)));
            return(new PolicyStatement(permSet, PolicyStatementAttribute.Nothing));
        }
Exemplo n.º 2
0
        private PolicyStatement CalculatePolicy(Url url)
        {
            URLString urlString = url.GetURLString();

            if (String.Compare(urlString.Scheme, "file", true, CultureInfo.InvariantCulture) != 0)
            {
                return(null);
            }

            String directory = urlString.GetDirectoryName();

            PermissionSet permSet = new PermissionSet(PermissionState.None);

            permSet.SetPermission(new FileIOPermission(m_access, directory));

            return(new PolicyStatement(permSet, PolicyStatementAttribute.Nothing));
        }