コード例 #1
0
        /// <summary>
        /// We need a username and a password, raise an event to fetch it.
        /// </summary>
        /// <param name="pwType">
        /// name of the username/password (e.g. 'Auth')
        /// </param>
        /// <returns>the given username and password, null if none</returns>
        internal string[] getLoginPass(string pwType)
        {
            if (noevents)
            {
                return(null);
            }

            m_logs.logDebugLine(1, "Asking user for username and password \"" + pwType + "\"");
            OVPNNeedLoginAndPasswordEventArgs args =
                new OVPNNeedLoginAndPasswordEventArgs(pwType);

            if (needLoginAndPassword != null)
            {
                needLoginAndPassword(this, args);
            }
            else
            {
                return(null);
            }

            return(new string[] { args.username, args.password });
        }
コード例 #2
0
        /// <summary>
        /// We need a username and a password, raise an event to fetch it.
        /// </summary>
        /// <param name="pwType">
        /// name of the username/password (e.g. 'Auth')
        /// </param>
        /// <returns>the given username and password, null if none</returns>
        internal string[] getLoginPass(string pwType)
        {
            if (noevents) return null;

            m_logs.logDebugLine(1, "Asking user for username and password \"" + pwType + "\"");
            OVPNNeedLoginAndPasswordEventArgs args =
                new OVPNNeedLoginAndPasswordEventArgs(pwType);

            if(needLoginAndPassword != null)
                needLoginAndPassword(this, args);
            else
                return null;

            return new string[] { args.username, args.password };
        }