zoukankan      html  css  js  c++  java
  • Aspx小记

    关闭按钮

     protected void Close_Click(object sender, EventArgs e)
        {
            //Page.RegisterStartupScript("close ", " <script> window.opener=null;window.top.close() </script> ");
            ClientScript.RegisterStartupScript(Page.GetType(), "close", " <script> window.opener=null;window.top.close() </script> ");
        }
    

      

    在后台里看到这样的一段代码

     Guid PK_Complaint = new Guid(dr["PK_Complaint"].ToString());//开始的时候不明白为什么还要加个new,可能是从string类型转成Guid的标准格式吧。
    

     主要是看这个out

     static void Main(string[] args)
          {
             decimal res=1;
             string str="0.1";//string str="asn";(这个是false,因为asn转不成decimal的类型
             bool convertible= decimal.TryParse(str,out res);//把str的类型,转换成res的类型
             Console.WriteLine(convertible);
             Console.ReadKey();
          }
    

      

    string[] IMEI_SN = info.Split(new char[] { ' ', ' ' }, StringSplitOptions.RemoveEmptyEntries);//算是以数组中的东西分割开来

    string test = "程$晓$";
    
      使用:string[] temp = test.Split(new string[] { "$" }, StringSplitOptions.RemoveEmptyEntries);
      输出结果:数组长度为2 temp[0]="程" temp[1]="晓";
     
    
      使用:string[] temp = test.Split(new string[] { "$" }, StringSplitOptions.None);或string[] temp = test.Split('$');
    
    
      输出结果:数组长度为3 temp[0]="程" temp[1]="晓" temp[2]="";
      
    

    在前台有个RadioButtonlist的按钮,在加载 的时候,从后台添加数据

     string[] ary = System.Configuration.ConfigurationManager.AppSettings["xxx"].Split(',');
       foreach (string i in ary)
          {
            RadioButtonList1.Items.Add(new ListItem(i));//这里的ListItem,因为Items是ListItemCollection
          } 

    在后台获取list选择的那个值:RadioButtonList1.SelectedValue.ToString() == ""
  • 相关阅读:
    【PowerDesigner】【2】将工具栏显示出来
    【PowerDesigner】【1】简单介绍
    【服务器】【Windows】【4】删除Windows系统中不想要的服务
    【Java】【8】StringUtils中isNotEmpty和isNotBlank的区别
    【Java】【7】枚举类
    hdu 1285
    Codeforces Round #198 (Div. 2) —— D
    Codeforces Round #198 (Div. 2) —— C
    Codeforces Round #198 (Div. 2) —— B
    Codeforces Round #198 (Div. 2) —— A
  • 原文地址:https://www.cnblogs.com/ZkbFighting/p/9453135.html
Copyright © 2011-2022 走看看