日期:2014-05-18 浏览次数:20407 次
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(txtUrl.Text); req.KeepAlive = false; HttpWebResponse res = (HttpWebResponse)req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream(), Encoding.Default); StringBuilder sb = new StringBuilder(); String strFilePath = @"e:\doc\" + DateTime.Now.ToString("MMddHHmmssfffff") + ".doc"; System.IO.StreamWriter sw = new System.IO.StreamWriter(strFilePath, false, System.Text.Encoding.GetEncoding("gb2312")); while (sr.Peek() != -1) sw.WriteLine(sr.ReadLine()); sw.Close(); System.Diagnostics.Process.Start(strFilePath);