using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO;//这是必须的
if (!File.Exists(MapPath("weather.txt"))) { Console.WriteLine("{0} does not exist.", MapPath("weather.txt")); return; } StreamReader sr = new StreamReader(MapPath("weather.txt"), System.Text.Encoding.Default); String input = sr.ReadToEnd(); sr.Close();