- 博客(13)
- 问答 (1)
- 收藏
- 关注
原创 字符串补0代码
private void radioButton1_CheckedChanged(object sender, EventArgs e) { //向前 String t1 = textBox1.Text.Trim(); StringBuilder t2 = new StringBuilder(); t
2016-10-31 16:36:07 255
原创 遍历datatable方法
DataSet ds = GetList(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows)
2016-10-31 15:49:44 299
原创 获取XML节点值得办法
try { string filePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "文件名称.XML"); XmlDocument xmlDoc = ConfigUtil.Instance.LoadXml(filePath
2016-10-31 15:44:33 320
原创 注册表操作类
public static class RegistryHelper { /// /// 保存值至注册表。 /// /// 名 /// 值 public static void SetValue(string name, string value) {
2016-10-31 15:31:51 173
原创 winform中自定义的窗体移动代码
分为三个事件组成 参考网上代码 bool formMove = false;//窗体是否移动 Point formPoint;//记录窗体的位置 // private bool p; /// /// 鼠标按下 /// /// ///
2016-10-31 15:18:25 519
原创 日期字符串互换
今天写了代码,目的是获取当前的日期放到数据库中,然后拿出来,从数据库中拿出来发生错误,经过一番查找发现,win10的系统当前日期时间的格式,在编程中需要更改默认的格式,不然会发生错误。
2016-10-30 22:10:58 238
原创 写了个C#验证公民身份证合法格式的函数
#region 判断身份号码测试 public static bool IdCard(String icd) { bool result = false; try { Regex reg = new Regex(@"^[1-9]\d{5}[1-9]\d{3}((0\d)
2016-10-25 22:25:18 749 1
原创 datagridview导出excel报表函数
public static void ExportDataGridViewToExcel(DataGridView dataGridview1) { try { if (dataGridview1.Rows.Count > 0) {
2016-10-24 11:22:09 472 1
原创 winform运行一个程序实例
static class Program { private static System.Threading.Mutex mutex; /// /// 应用程序的主入口点。 /// [STAThread] static void Main() {
2016-10-21 14:06:02 524
原创 关于数据最大ID 的操作函数
分享此函数方便以后的使用 此函数应用场景为:当ID为自增长的时候,数据库执行为insert语句时候,进行的回滚操作。 #region 执行删除第一行数据 public static bool deletop
2016-10-12 11:01:08 255
原创 C# 返回一定时间内数据库存取过的文件名列表
#region 返回数据库存取过的文件名列表 //a 代表天数, public static List Select(int a) { DateTime dt1 = DateTime.Now; DateTime dt2= dt1.AddDays((0-a-1)); List
2016-10-12 10:56:47 284
原创 实体类的使用
public partial class Handle { #region Model private String _HandleTime; private string _HandleFileName; private string _HandleReult; /// ///
2016-10-08 18:03:04 603
原创 app.config文件的读写
下图为读取代码 #region 返回监控文件夹的路径 public String MoiDir() { String path = ""; ExeConfigurationFileMap file = new ExeConfigurationFileMap(); fi
2016-10-08 18:01:44 271
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人