C#:请问高手 找不到类型或命名空间名称“HTTPWebRequest”(是否缺少 using 指令或程序集引用?)

主要程序
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using System.IO;
using System.Net;

.........

//定义变量
public HTTPWebRequest req;
public HTTPWebResponse res;
public Stream s;
public StreamReader r;
//发送HTTP请求并接受HTTP应答
private void button1_Click(object sender, System.EventArgs e)
{
if(textBox1.Text.Length!=0)
{
button1.Enabled=false;
req=(HTTPWebRequest)WebRequest.Create(textBox1.Text);
res=(HTTPWebResponse)req.GetResponse();
s=res.GetResponseStream();
r=new StreamReader(s);
richTextBox1.Text=r.ReadToEnd();
r.Close();
s.Close();
res.Close();
button1.Enabled=true;
}

2165 浏览 1 回复
  using   system   res   public   httpwebrequest  

回复

    HTTPWebResponse 改成 HttpWebRequest 注意大小写。

    王广

相关提问


友情链接: