//取得整个页面内容
using System.Net;
WebClient Client = new WebClient();
Stream strm = Client.OpenRead("http://fund3.eastmoney.com/450003.html");
StreamReader sr = new StreamReader(strm);
string line;
while ((line = sr.ReadLine()) != null)
{
StreamWriter sw = new StreamWriter("d://123.txt", true, Encoding.GetEncoding("gb2312"));
sw.WriteLine(line);
sw.Close();
}
strm.Close();
//取得title里的内容
WebClient sHttpWebClinet = new WebClient();
byte[] str1 = sHttpWebClinet.DownloadData(uri);
string strWebText = System.Text.Encoding.Default.GetString(str1);
Int32 i1 = strWebText.IndexOf(" <title> ") + 7;
Int32 i2 = strWebText.IndexOf(" </title> ") - 1;
string title = strWebText.Substring(i1, i2 - i1);
//上传数据,小文件
WebClient Client = new WebClient();
Client.UploadFile(strUrl,"POST",fileName);