Akismet.NET.Validator.VerifyKey C# (CSharp) Method

VerifyKey() public method

Check if the validator's key is valid or not.
public VerifyKey ( String domain ) : System.Boolean
domain String
return System.Boolean
        public Boolean VerifyKey(String domain)
        {
            // prepare pars for the request
            NameValueCollection pars = PreparePars(m_key, domain);
            if (null != pars)
            {
                // extract result from the request
                return ExtractResult(PostRequest("http://rest.akismet.com/1.1/verify-key", pars));
            }

            // return failure
            return false;
        }

Usage Example

Esempio n. 1
0
        private IValidator get_api()
        {
            var api = new Validator(AksimetKey);

            if (api.VerifyKey(Domain) == false)
            {

                return null;
            }

            return api;
        }