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

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

本文简介:选择自 dancefire 的 blog

        
        //required by the web services designer
        private icontainer components = null;
                
        
/// <summary>
        /// required method for designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        
private void initializecomponent()
        {
        }

        
/// <summary>
        /// clean up any resources being used.
        /// </summary>
        
protected override void dispose( bool disposing )
        {
            if(
disposing && components != null)
            {
                
components.dispose();
            }
            
base.dispose(disposing);        
        }
        
        
#endregion

        
[webmethod]
        
public xmldatadocument getforeignexchangerates()
        {
            return
getxmldoc();
        }
        [
webmethod]
        
public dataset getforeignexchangeratesdataset()
        {
            return
getxmldoc().dataset;
        }
        [
webmethod]
        
public string getbankpage()
        {
            return
getwebcontent( "http://www.bank-of-china.com/info/whjrpj.html" );
        }
        
//    private methods
        
private string getwebcontent( string url )
        {

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

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

go top