摘要: import smtplibfrom email.mime.text import MIMETextdef SendEmail(): email = "" #设置收件地址 mailto_list=[email] mail_host="" #设置服务器 mail_user... 阅读全文
posted @ 2015-02-06 15:49 ZCoding 阅读(952) 评论(0) 推荐(0) 编辑
摘要: 第一种方式:System.Diagnostics.Stopwatch stopwatch = new Stopwatch();stopwatch.Start(); // 开始监视代码运行时间// 需要测试的代码 ....stopwatch.Stop(); // 停止监视TimeSpan tim... 阅读全文
posted @ 2015-02-05 09:55 ZCoding 阅读(23811) 评论(1) 推荐(3) 编辑
摘要: 1、新建项目添加WatermarkTextBox类:using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.Drawing;using System... 阅读全文
posted @ 2015-02-03 11:59 ZCoding 阅读(4993) 评论(0) 推荐(0) 编辑
摘要: 第一种方法:正则表达式 string text = "是不是汉字"; for (int i = 0; i = 0x4e00 && (int)c[i] 127) Console.WriteLine("是汉字"); ... 阅读全文
posted @ 2015-01-08 10:52 ZCoding 阅读(5107) 评论(0) 推荐(0) 编辑
摘要: 第一种方法:try{ if (int.Parse(textBox1.Text) > 0) { //操作代码 } else { MessageBox.Show("必须是正整数"); }}catch (FormatException){ ... 阅读全文
posted @ 2015-01-08 10:32 ZCoding 阅读(4352) 评论(0) 推荐(0) 编辑
摘要: /// java时间戳格式时间戳转为C#格式时间 public static DateTime GetTime(long timeStamp){ DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970... 阅读全文
posted @ 2014-12-29 17:12 ZCoding 阅读(2947) 评论(0) 推荐(0) 编辑
摘要: 1、同时显示日期和时间DateTimePicker dtp = new DateTimePicker(); dtp.Format = DateTimePickerFormat.Custom;dtp.CustomFormat = "yyyy-MM-dd HH:mm:ss";2、时间选择方式dtp.Sh... 阅读全文
posted @ 2014-12-29 16:49 ZCoding 阅读(8177) 评论(0) 推荐(0) 编辑