随笔分类 -  开发通用代码

摘要:MailMessage mailMsg = new MailMessage(); mailMsg.Priority = MailPriority.High;//设置邮件优先级 mailMsg.From = new MailAddress("anyubo873387048@163.com", "安玉波");//设置发件邮箱(邮箱地址,用户名) mailMsg.To.Add(new MailAddress(txtName.Text.Trim(), txtName.Text.Trim()));//设置收件邮箱地址(邮箱地址,用户名) mailMsg.Subje 阅读全文
posted @ 2012-06-05 16:06 小笨熊象 阅读(126) 评论(0) 推荐(0)
摘要:#region 截取字符串 public static string stringformat(string str, int n) { string temp = string.Empty; if (System.Text.Encoding.Default.GetByteCount(str) <= n)//如果长度比需要的长度n小,返回原字符串 { return str; } else { int t = 0; char[] q = str.ToCharArray(); for (int i = 0; i < q.Length && t < n; i++) 阅读全文
posted @ 2012-04-24 14:01 小笨熊象 阅读(155) 评论(0) 推荐(0)