• C# WebClient的使用


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;


    namespace WebClientExam
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                WebClient client = new WebClient();
                Stream s = client.OpenRead("http://www.163.com");
                StreamReader sr = new StreamReader(s);
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    listBox1.Items.Add(line);
                }
                s.Close();


            }
        }
    }
  • 相关阅读:
    论财务的意义
    项目忙乱的原因
    回家的路
    但问耕耘
    做自己的主角
    坚持的意义
    觉醒的意义
    梦想的力量
    把自己当作一件艺术品
    九宫格年度计划
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434770.html
Copyright © 2020-2023  润新知