-1

I'm using Visual Studio to code in C#. This is my part of code where I have some problems:

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;

That's what I included:

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;

And I still get this error:

The type or namespace "HTTPGet" could not be found.

What can I do?

waka
  • 3,362
  • 9
  • 35
  • 54

1 Answers1

0

i think you want create http request through GET. also you need something similar to HttpWebRequest:

C# how to properly make a http web GET request

or maybe you mix up with attributes Understanding [HttpPost], [HttpGet] and Complex Actionmethod parameters in MVC

struggleendlessly
  • 108
  • 2
  • 2
  • 8