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

  • 相关阅读:
    你的想像力智商有多高?
    Visual FoxPro 9.0 发布
    Google的社会网络
    女人永远是对的
    如何保存ICQ聊天历史
    7 30 个人赛
    Linux下利用文件描述符恢复的成功失败实验
    蓝鲸社区版部署
    Oracle 10.2.0.5升级至11.2.0.4
    手动创建Oracle实例
  • 原文地址:https://www.cnblogs.com/ctriphire/p/2914322.html
Copyright © 2011-2022 走看看