Here's the thing: I want to get the string named "IPAddress" from FullParse.cs to Form1.cs. What would it be if I'll get multiple variables aside from "IPAddress"?
Here's the code I've made
FullParse.cs
using RestSharp;
namespace WindowsFormsApp2
{
internal class FullParse
{
public void getIP() {
RestClient client = new RestClient("http://ip-api.com/json/?fields=9009");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
string source = (response.Content);
dynamic data = JObject.Parse(source);
string IPAddress = data.query;
}
}
}
Form1.cs
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
FullParse fullParse = new FullParse();
}
}
}
It's still my first time using C# especially OOP so I don't really know if i'm doing this right.