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

  • 相关阅读:
    面向对象程序设计六大原则
    获取View的快照
    Xcode调试之exc_bad_access以及 message sent to deallocated instance
    OOA/OOD/OOP
    检测网络是否有效
    图像IO
    iOS应用性能调优的25个建议和技巧
    iOS围绕某点缩放或旋转的AnchorPoint的设定
    NPOI导出Excel2007板
    不同三级域名与二级域名之间互相共享Cookie
  • 原文地址:https://www.cnblogs.com/ctriphire/p/2914322.html
Copyright © 2011-2022 走看看