当前位置: 首页>>代码示例>>C#>>正文


C# MailChimpManager.GetVerifiedDomains方法代码示例

本文整理汇总了C#中MailChimpManager.GetVerifiedDomains方法的典型用法代码示例。如果您正苦于以下问题:C# MailChimpManager.GetVerifiedDomains方法的具体用法?C# MailChimpManager.GetVerifiedDomains怎么用?C# MailChimpManager.GetVerifiedDomains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MailChimpManager的用法示例。


在下文中一共展示了MailChimpManager.GetVerifiedDomains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidateFields

        /// <summary>
        /// Validate Nexmo Settings and MailChimp Settings
        /// </summary>
        /// <returns>true or false</returns>
        public bool ValidateFields()
        {
            if (string.IsNullOrEmpty(txtNexmoAPI.Text.Trim()))
            {
                MessageBox.Show("Please enter the Nexmo Key.", "Nexmo Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtNexmoAPI.Focus();
                return false;
            }
            if (string.IsNullOrEmpty(txtNexmoSecretKey.Text.Trim()))
            {
                MessageBox.Show("Please enter the Nexmo Secret. ", "Nexmo Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtNexmoSecretKey.Focus();
                return false;
            }
            if (string.IsNullOrEmpty(txtMailChimpAPI.Text.Trim()))
            {
                MessageBox.Show("Please enter the MailChimp Api Key. ", "MailChimp Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtMailChimpAPI.Focus();
                return false;
            }

            try
            {
                string fromNumber = SmsSender.GetAccountNumber(txtNexmoAPI.Text.Trim(), txtNexmoSecretKey.Text.Trim());
                if (string.IsNullOrEmpty(fromNumber.Trim()))
                {
                    MessageBox.Show("Not found MISDN number in Nexmo.", "Nexmo Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return false;
                }
                else
                {
                    FromNumber = fromNumber;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Please enter valid Nexmo Key and Secret.", "Nexmo Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return false;
            }
            try
            {
                MailChimpManager mc = new MailChimpManager(txtMailChimpAPI.Text.Trim());
                var ss = mc.GetVerifiedDomains();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Please enter valid MailChimp API Key.", "MailChimp Settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return false;
            }
            return true;
        }
开发者ID:AdvaiyaLabs,项目名称:MailChimp-with-Nexmo-SMS,代码行数:55,代码来源:Settings.cs

示例2: GetVerifiedDomains_Successful

        public void GetVerifiedDomains_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);

            //  Act
            List<VerifiedDomain> domains = mc.GetVerifiedDomains();

            //  Assert
            Debug.WriteLine(domains.Count);
            Assert.AreNotEqual(0, domains.Count);
        }
开发者ID:erpframework,项目名称:MailChimp.NET,代码行数:12,代码来源:HelperTests.cs


注:本文中的MailChimpManager.GetVerifiedDomains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。