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;
    }

  • 相关阅读:
    C++中的关键概念:名字查找与继承
    调用哪个虚函数的问题
    二叉树基础知识
    赫夫曼树及其应用
    用MyEclipse搭建SSH框架 Struts Spring Hibernate
    数据库 事务的特性ACID
    网桥与交涣机
    Adobe Edge Animate 1.0 概述
    【官方】Adobe Edge Preview 3 初学者指南
    Adobe Edge , Flash 未来的方向?
  • 原文地址:https://www.cnblogs.com/ctriphire/p/2914322.html
Copyright © 2011-2022 走看看