-2
我正在使用Visual Studio在C#中進行編碼。 這是我的代碼的一部分,我有一些問題:無法找到類型或命名空間「HTTPGet」
HttpGet req = new HttpGet();
req.Request("http://checkip.dyndns.org");
string[] a = req.ResponseBody.Split(':');
string a2 = a[1].Substring(1);
string[] a3 = a2.Split('<');
string a4 = a3[0];
label3.Text = "Public IP Address: " + a4;
這就是我包括:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Management;
using static System.Object;
using System.Net.Http;
我仍然得到這個錯誤:
The type or namespace "HTTPGet" could not be found.
我能做些什麼?
@KobyDouek類型或命名空間名稱「HTTP」不會在命名空間「System.Web程序」存在(你錯過了一個程序集引用嗎?) –
這是一個MVC項目嗎? Web表單?的WinForms? –
@KobyDouek Windows窗體應用程序 –