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