Пример #1
0
        //
        public static CodeConnectAccess CreateOriginSchemeAccess(int allowPort)
        {
            CodeConnectAccess access = new CodeConnectAccess();

            access.SetCodeConnectAccess(OriginScheme, allowPort);
            return(access);
        }
Пример #2
0
        /// <summary>Returns a <see cref="T:System.Security.Policy.CodeConnectAccess" /> instance that represents access to the specified port using any scheme.</summary>
        /// <param name="allowPort">The port represented by the returned instance.</param>
        /// <returns>A <see cref="T:System.Security.Policy.CodeConnectAccess" /> instance for the specified port.</returns>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        ///         <paramref name="allowPort" /> is less than 0.-or-
        ///         <paramref name="allowPort" /> is greater than 65,535.</exception>
        // Token: 0x0600296A RID: 10602 RVA: 0x00098804 File Offset: 0x00096A04
        public static CodeConnectAccess CreateAnySchemeAccess(int allowPort)
        {
            CodeConnectAccess codeConnectAccess = new CodeConnectAccess();

            codeConnectAccess.SetCodeConnectAccess(CodeConnectAccess.AnyScheme, allowPort);
            return(codeConnectAccess);
        }
Пример #3
0
        /// <summary>返回一个 <see cref="T:System.Security.Policy.CodeConnectAccess" /> 实例,该实例表示使用任何方案对指定端口的访问权限。</summary>
        /// <returns>指定端口的 <see cref="T:System.Security.Policy.CodeConnectAccess" /> 实例。</returns>
        /// <param name="allowPort">返回的实例表示的端口。</param>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// <paramref name="allowPort" /> 小于 0。- 或 -<paramref name="allowPort" /> 大于 65,535。</exception>
        public static CodeConnectAccess CreateAnySchemeAccess(int allowPort)
        {
            CodeConnectAccess codeConnectAccess = new CodeConnectAccess();
            string            lowerCaseScheme   = CodeConnectAccess.AnyScheme;
            int allowPort1 = allowPort;

            codeConnectAccess.SetCodeConnectAccess(lowerCaseScheme, allowPort1);
            return(codeConnectAccess);
        }
 //
 public static CodeConnectAccess CreateAnySchemeAccess(int allowPort)
 {
     CodeConnectAccess access = new CodeConnectAccess();
     access.SetCodeConnectAccess(AnyScheme, allowPort);
     return access;
 }