利用正则表达式将html网页数据变成Web Service[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 dancefire 的 blog

            using( webclient client = new webclient() )
            {
                
byte[] buffer = client.downloaddata( url );
                
string str = encoding.getencoding("gb2312").getstring( buffer, 0, buffer.length );
                return
str;
            }
        }
        
private xmldatadocument getxmldoc()
        {
            
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) );

本文关键:利用正则表达式将html网页数据变成Web Service
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top