常用帮助

1、Window Form: 获取当前路径:Application.StartupPath

2、控制台程序获得当前路径: System.Environment.CurrentDirectory

3、查询某个具体的xml节点: string xPath = "节点名称[@属性名称(字符型)='"+ 值 +"' and @属性名称(int型)="+ 值 +"]"

4、sql 2005的row_number() 是用法
    select *
    from
    (select row_number() over (partition by SecurityId,PersonId order by AsOfDate desc) as rank,*
     from OwnerShipHolding where SecurityId='0P00008EYI' )x
    where rank<4
    order by SecurityId,PersonId,AsOfDate desc

5、用程序判断网页服务器是不是连通状态
    WebRequest wrq = WebRequest.Create(myUri);
    WebResponse wrs = wrq.GetResponse();  

     Stream strm = wrs.GetResponseStream();
      StreamReader sr = new StreamReader(strm, System.Text.Encoding.GetEncoding( "gb2312" ));      
      //读取网页
      string allHtml = sr.ReadToEnd();

posted @ 2008-08-07 12:34  谢杰  阅读(282)  评论(0编辑  收藏  举报