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>");

  • 相关阅读:
    WCF使用net.tcp寄宿到IIS中
    (转)Dubbo 简单Dome搭建
    Linux压缩解压
    Linux关闭开启防火墙命令
    简单登录(jsp+servlet)
    UVa 10285 Longest Run on a Snowboard [DP]
    UVa 1218 Perfect Service [DFS+DP]
    第三届ACM山东省赛 Pick apples [贪心+动规]
    ZOJ 3326
    HDU 1029
  • 原文地址:https://www.cnblogs.com/hishanghai/p/2527933.html
Copyright © 2011-2022 走看看