Create a gist now

Instantly share code, notes, and snippets.

@YoiTaka /GetHeml1.cs
Last active Aug 18, 2016

指定したURLのhtmlファイルを取得する(VSから起動するVer)
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
System.IO.StreamWriter sw = new System.IO.StreamWriter("google.html", false, System.Text.Encoding.UTF8);
try
{
string text = wc.DownloadString("https://www.google.co.jp/");
sw.WriteLine(text);
}
catch (WebException exc)
{
sw.WriteLine(exc.Message);
}
sw.Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment