I want to achieve the most simple thing. That is request a aspx page from a c# console application, and then the aspx page should give a string back to the c# app.
I have searched around alot, but couldn't really find anything :(
Lets say my page is called www.example.com/default.aspx. And from my C# app, i make a request to that page, and then that page should just return a string saying "Hello".
Below, i have wrote in pseudo code on how i believe it should be done.
C# app
public static void Main(string[] args)
{
//1. Make request to the page: www.example.com/default.aspx
//2. Get the string from that page.
//3. Write out the string. (Should be "Hello")
Console.ReadLine();
}
.aspx code
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string text = "Hello";
//1. Return the "text" variable to the client that requested this page
}
}