using System.Net;
using System.IO;
public partial class Modules_News_Weather : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
string web = "http://tw.weather.yahoo.com/"; //http://tw.weather.yahoo.com/ //http://www.baidu.com/
WebClient wc = new WebClient();
wc.Credentials = CredentialCache.DefaultCredentials;
wc.Headers.Set("User-Agent", "Microsoft Internet Explorer");
Stream resStream = wc.OpenRead(web);
StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default);
string code = sr.ReadToEnd();
Response.Write(code);
//很可能獲得亂碼頁面......
string jstext = "<script LANGUAGE=/"javascript/">window.open('http://tw.weather.yahoo.com/', 'WindowName','height=400, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no')</script>";
//ClientScript.RegisterStartupScript(this.GetType(), "js", jstext);
resStream.Close();
}
}