本文整理汇总了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;
}
示例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);
}