zoukankan      html  css  js  c++  java
  • 代码积累

    (1)String cusId = Request["cusId"]??"0";

    (2)

    protected void Page_Load(object sender, EventArgs e)
    {
    try
    {
    string funcName =Request["funcName"];
    if (!string.IsNullOrEmpty(funcName))
    {
    Type type = this.GetType();
    string methodName = "Exec" + funcName;
    MethodInfo method = type.GetMethod(methodName);
    method.Invoke(this, null);
    }
    }
    catch
    {
    Response.Write("funcName不存在!");
    }
    }
    public void ExecLinkMan()
    {
    Response.Write("LinkMan");
    }
    public void ExecCustomer()
    {
    Response.Write("ExecCustomer");
    }

    (3)设置默认值

    [System.ComponentModel.DefaultValue(true)]
    public Boolean IsRightOpt { get; set; }//是否需要验证权限操作

    (4)读取一网页  并对其数据进行操作

    public static string[] GetPoint(string addr)
    {
    string[] arrag = null;
    string path = "http://maps.googleapis.com/maps/geo?output=csv&q=" + addr;
    try
    {
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(path);
    request.Method = "get";
    HttpWebResponse resp = (HttpWebResponse)request.GetResponse();
    request.Timeout = 30 * 1000;
    if (resp.StatusCode == HttpStatusCode.OK)
    {
    StreamReader stream = new StreamReader(resp.GetResponseStream(), Encoding.UTF8);
    //格式:200,4,31.2219590,121.5447210
    string body = stream.ReadToEnd();
    arrag = body.Split(',');
    resp.Close();
    }
    }
    catch
    {
    }
    return arrag;
    }

    5:定义属性的简写

    public String ClientZipcode
    {
    get;
    set;
    }

  • 相关阅读:
    go chapter 4
    go chapter 3
    ETCD相关介绍--整体概念及原理方面
    go chapter 2
    go chapter 1
    使用kubeadm搭建kubernetes1.10集群 Posted on April 14, 2018
    单用户passwd修改root密码没反应
    is not in the sudoers file解决方案
    版本更换,开始学习鸟哥的私房菜
    ubuntu 常见命令
  • 原文地址:https://www.cnblogs.com/ctriphire/p/2914322.html
Copyright © 2011-2022 走看看