zoukankan      html  css  js  c++  java
  • 小操作

    string sqlCmd = string.Format("select COUNT(distinCt(BARCODE)) from [dbo].[SendAcerData] where INV_NO='{0}'", dtInv.Rows[i][0].ToString());
                            dtt = SqlHelper.Query(sqlCmd);
    字符串的格式化

    Split拆分后的是一个数组

    判断字符串为空

    string.IsNullOrEmpty(XXX)

    快速生成Get Set属性

    prop 按两下Tab

    选中一列的值

    列如

    string a;

    string b;

    选中string 加入ALT便可选中 方便修改。

    增加天数和时间格式转换

    将String日期转成DateTime再转成String

    string strSftDate=“20191016”;
    DateTime date=DateTime.ParseExact(strSftDate,"yyyyMMdd",System.Globalization.CultureInfo.CurrentCulture);
    strSftDate = date.AddDays(1).ToString("yyyyMMdd");
    //完成天数增加并且返回sting 因为DateTime格式时分秒去不掉
    View Code

     C# winform 定时器控件(看CSDN 作者una_ting的博客)

    timer_MainForm.Enable = true;

    timer_MainForm.Interval = 500;  //定时器时间间隔

    timer_MainForm.Start();   //定时器开始工作

    设置定时器属性

    定时实现的行为可在Tick事件中实现。

      private void timer_MainForm_Tick(object sender, EventArgs e)
     {
    
         //具体实现的方法
    
         //
    
    }
    View Code

    子控件事件冲突,无法实现Mouse事件,最后只能采取坐标的方法。

    DataGirdView中checkbox是否选中代码,Value不行选用EditedFormattedValue

    if ((bool)grdData.Rows[i].Cells["Select"].EditedFormattedValue==false )
    {
    
    }

     字符串四舍五入 取小数点后1位

    string WaitMinute;
    
    Convert.ToDouble(WaitMinute).ToString("0.0");//几个0取几位

     字符串不四舍五入 取小数点后1位

    string WaitMinute;
    double m3 = Math.Truncate((Convert.ToDouble(WaitMinute)) * 10) / 10;
  • 相关阅读:
    vim讲解
    tar常用解包
    linux扩展权限
    为Virtualbox中的Solaris10安装VBoxAdditions
    Solaris10下Telnet、SSH、ftp使用root登录
    linux软链接和硬链接
    curl命令学习(转载的)
    linux磁盘分区fdisk命令详解
    在服务器上排除问题的头五分钟
    Java对文件压缩/加密/解密/解压缩的例子,DES/RSA
  • 原文地址:https://www.cnblogs.com/cdjbolg/p/11677095.html
Copyright © 2011-2022 走看看