WebClient client = new WebClient();
using (Stream stream = client.OpenRead("http://localhost/license/main.ashx?order=1&email=This email address is being protected from spambots. You need JavaScript enabled to view it.))
{
using (StreamReader reader = new StreamReader(stream, Encoding.Default))
{
string input = reader.ReadToEnd();
lblResult.Text = input;//lblResult is a textbox
}
}
the codes in ashx file are -
namespace MITSOL
{
public class main : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
HttpResponse r = context.Response;
r.ContentType ="text/plain" ;
string file = context.Request.QueryString["order"];
if (order == "1")
{
r.Write("ok");
//you can get any data from here to pass
}
else
{
r.Write("wrong");
}
}
public bool IsReusable {get{return false;}}
}
}