zoukankan      html  css  js  c++  java
  • Tips

    Window

    protected void Mess(string Mes)
        {
            this.ClientScript.RegisterStartupScript(GetType(), "a""alert('" + Mes + "');"true);
        }

    VS向SQL中寫入DateTime:

    SqlParameter[] sqlParaInsert = new SqlParameter[] { 
                new SqlParameter("@empNo", txt_Employee_No.Text.Trim()),
                new SqlParameter("@password",FormsAuthentication.HashPasswordForStoringInConfigFile(LblPassword.Text.Trim(), "md5").ToString()), 
                new SqlParameter("@Hours",DropDownList2.SelectedValue.ToString()),
                new SqlParameter("@flyerID",DropDownList1.SelectedValue.ToString()),
                new SqlParameter("@startTime",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                new SqlParameter("@endTime",DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH:mm:ss"))
                };
     
     

     可以向SQL中定义的Int 类型的数据 传入Sting类型的数据,  getdate()自动获得服务器的时间,标识列:SQE

    string HostName = System.Net.Dns.GetHostName();
    string HostName2 = System.Net.Dns.GetHostEntry(Request.UserHostName).HostName;
     Response.Write(HostName);
     Response.Write(HostName2);

     一个字符串在另一个字符串中出现的位置

    string r = ADPath.Replace("OU=", "");
    int num = (ADPath.Length - r.Length) / 3;

    相同字符截取字符串

    using System.Text.RegularExpressions;
    string str="aaajsbbbjsccc";
    string[] sArray=Regex.Split(str,"js",RegexOptions.IgnoreCase);
    foreach (string i in sArray) Response.Write(i.ToString() + "<br>");

  • 相关阅读:
    datatables出现横向滚动条
    mumu模拟器设置代理/打开网络连接(windows)
    a标签下划线
    python 配置导入方式
    redis命令
    django+mongodb 内置用户控制
    异常补充
    关于异常的总结
    java 常用类的方法
    java 日期时间类加Calendar的set和add方法
  • 原文地址:https://www.cnblogs.com/hishanghai/p/2527933.html
Copyright © 2011-2022 走看看