listBox1.Items.Add(line);// 这里有个错误说是Items参数值不能为空 求解释
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using
using
namespace BasicWebClient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
WebRequest wrq = WebRequest.Create("http://www.);
WebResponse wrs = wrq.GetResponse();
Stream strm = wrs.GetResponseStream();
StreamReader sr = new StreamReader(strm);
string line;
while ((line = sr.ReadLine()) != null) ;
{
listBox1.Items.Add(line);// 这里有个错误说是Items参数值不能为空 求解释
}
strm.Close();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}