-
Notifications
You must be signed in to change notification settings - Fork 2
/
RemotePost.cs
44 lines (36 loc) · 1.71 KB
/
RemotePost.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace Nevoweb.DNN.NBrightBuyPayPal
{
public class RemotePost
{
private System.Collections.Specialized.NameValueCollection Inputs = new System.Collections.Specialized.NameValueCollection();
public string Url = "";
public string Method = "post";
public string FormName = "form";
public void Add(string name, string value)
{
Inputs.Add(name, value);
}
public string GetPostHtml(string loadingImageUrl)
{
string sipsHtml = "";
sipsHtml = "<html><head>";
sipsHtml += "</head><body onload=\"document." + FormName + ".submit()\">";
sipsHtml += "<form name=\"" + FormName + "\" method=\"" + Method + "\" action=\"" + Url + "\">";
int i = 0;
for (i = 0; i <= Inputs.Keys.Count - 1; i += 1)
{
sipsHtml += "<input type=\"hidden\" name=\"" + Inputs.Keys[i] + "\" value=\"" + Inputs[Inputs.Keys[i]] + "\" />";
}
sipsHtml += "</form>";
sipsHtml += " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">";
sipsHtml += "<tr><td width=\"100%\" height=\"100%\" valign=\"middle\" align=\"center\">";
sipsHtml += "<font style=\"font-family: Trebuchet MS, Verdana, Helvetica;font-size: 14px;letter-spacing: 1px;font-weight: bold;\">";
sipsHtml += "Processing...";
sipsHtml += "</font><br /><br /><img src=\"" + loadingImageUrl + "\" /> ";
sipsHtml += "</td></tr>";
sipsHtml += "</table>";
sipsHtml += "</body></html>";
return sipsHtml;
}
}
}