利用XMLHTTP获取源文件代码添加引用-COM-Microsoft Xml 3.0,然后在代码开始处写:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MSXML2;
namespace XmlHttpConsole
{
class Program
{
static void Main(string[] args)
{
string Url = "http://www.fly020.com/";
MSXML2.XMLHTTP _xmlHttp = new MSXML2.XMLHTTPClass();
_xmlHttp.open("get", Url, false, null, null);
_xmlHttp.send("");
if (_xmlHttp.readyState == 4)
{
Console.WriteLine(_xmlHttp.responseText);
}
Console.ReadLine();
}
}
}