• λ我爱Aspx >> Asp.Net >> 利用正则表达式将html网页数据变成Web Service
  • 利用正则表达式将html网页数据变成Web Service

  • :aspxer  Դ:internet  :2007-5-28 20:36:39  ؼ:web,数据
  • {

    string webcontent = getWebContent("http://www.bank-of-china.com/info/whjrpj.html");

    // Prepair for DataSet

    DataSet ds = new DataSet("Exchange");

    DataTable dt = new DataTable("ForeignExchange");

    ds.Tables.Add( dt );

    dt.Columns.Add( "Currency", typeof(string) );

    dt.Columns.Add( "BankBuyTT", typeof(double) );

    dt.Columns.Add( "BankBuyNotes", typeof(double) );

    dt.Columns.Add( "BankSell", typeof(double) );

    dt.Columns.Add( "Baseline", typeof(double) );

    XmlDataDocument xmldoc = new XmlDataDocument( ds );

    Regex expr = new Regex(

    @"<tr bgcolor=@##\w+@# ><td height=@#20@#>(?<currency>.*)</td>\s*" +

    @"<td height=@#20@#><p align=@#right@#>(?<bankbuytt>\d*.?\d*)(&nbsp)+.?</td>\s*" +

    Ҷƪл˵?
  • һƪWeb Services是什么?
    һƪ使用Google的Web Service