Remotely Redirect to any URL using .Net
Use this class to remotely redirect to any URL. simply make instance of same and use post method for same it will redirect you on given URL.
namespace RemotePost
{
public class RemoteLogin
{
private System.Collections.Specialized.NameValueCollection Inputs = new System.Collections.Specialized.NameValueCollection();
public string Url = string.Empty;
public string Method = "post";
public string FormName = "form1";
public void Add(string name, string value)
{
Inputs.Add(name, value);
}
public void Post()
{
System.Web.HttpContext.Current.Response.Clear();
// System.Web.HttpContext.Current.Response.ContentType = "application/x-shockwave-flash";
// System.Web.HttpContext.Current.Response.Headers.Add("Accept-Encoding", "gzip");
System.Web.HttpContext.Current.Response.Write("");
System.Web.HttpContext.Current.Response.Write(string.Format("", FormName));
System.Web.HttpContext.Current.Response.Write(string.Format("
for (int i = 0; i <>
{
System.Web.HttpContext.Current.Response.Write(string.Format("", Inputs.Keys[i], Inputs[Inputs.Keys[i]]));
}
System.Web.HttpContext.Current.Response.Write("");
System.Web.HttpContext.Current.Response.Write("");
System.Web.HttpContext.Current.Response.End();
}
}
}
Comments