⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class1.cs

📁 C#开发教程 由浅入深 配有实例 是初学者的好帮手
💻 CS
字号:
using System;
using System.IO;
using System.Net;

namespace WebPages
{
    public class WebPagesApp
    {
        [STAThread]
        public static void Main(string[] args)
        {
            string s = "http://www.microsoft.com";
            Uri uri = new Uri(s);
            WebRequest req = WebRequest.Create(uri);
            WebResponse resp = req.GetResponse();
            Stream str = resp.GetResponseStream();
            StreamReader sr = new StreamReader(str);

            string t = sr.ReadToEnd();
            int i = t.IndexOf("<HEAD>");
            int j = t.IndexOf("</HEAD>");
            string u = t.Substring(i, j);
            Console.WriteLine("{0}", u);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -