forked from plivo/plivo-examples-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXML_Dial_No_and_User.cs~
47 lines (45 loc) · 1.57 KB
/
XML_Dial_No_and_User.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
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Plivo;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
string user = "";
string num = "";
Plivo.XML.Dial dial = new Plivo.XML.Dial(new Dictionary<string, string>() { });
if (Request.HttpMethod == "GET")
{
int i = 0;
for(;i<Request.QueryString.Count;i++)
{
if (Request.QueryString.GetKey(i) == "Numbers")
dial.AddNumber(Request.QueryString.Get(i), new Dict
ionary<string, string>());
else if (Request.QueryString.GetKey(i) == "Users")
dial.AddUser(Request.QueryString.Get(i), new Dictionary<string, string>());
}
resp.Add(dial);
}
else if(Request.HttpMethod == "POST")
{
int i = 0;
for (; i < Request.Form.Count; i++)
{
if (Request.Form.GetKey(i) == "Numbers")
dial.AddNumber(Request.Form.Get(i), new Dictionary<string, string>());
else if (Request.Form.GetKey(i) == "Users")
dial.AddUser(Request.Form.Get(i), new Dictionary<string, string>());
}
resp.Add(dial);
}
Response.Write(resp.ToString());
Response.ContentType = "text/xml";
Response.End();
}
}