本文整理匯總了C#中Cat.GetImage方法的典型用法代碼示例。如果您正苦於以下問題:C# Cat.GetImage方法的具體用法?C# Cat.GetImage怎麽用?C# Cat.GetImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cat
的用法示例。
在下文中一共展示了Cat.GetImage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SendMail
private static void SendMail(Cat cat)
{
try
{
var loginInfo = new NetworkCredential("kakifis[email protected]", "V746025625VLADIMIRNO");
var msg = new MailMessage { From = new MailAddress("[email protected]") };
msg.To.Add(new MailAddress("[email protected]"));
msg.Subject = "Cats!!";
msg.Body = "<p>Cat deleted:</p><p><b>breed:</b></p><p>" + cat.GetBreed() + "</p>country" + cat.GetCountry() + "</p><p><b>origin:</b> " + cat.GetOrigin() + "</p><p><b>body type:</b> " + cat.GetBodyType() + "</p><p><b>coat:</b> " + cat.GetCoat() + "</p><p><b>pattern:</b> " + cat.GetPattern() + "</p><p><b>image:</b> " + cat.GetImage() + "</p><p><b>information:</b> " + cat.GetInfo() + "</p>";
msg.IsBodyHtml = true;
var client = new SmtpClient("smtp.gmail.com")
{
EnableSsl = true,
UseDefaultCredentials = false,
Credentials = loginInfo
};
client.Send(msg);
}
catch (Exception ex)
{
var msg = "Failed to send message: ";
msg += ex.Message;
throw new Exception(msg);
}
}