- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFireNET.cs
More file actions
Latest commit
54 lines (47 loc) · 1.34 KB
/
Copy pathFireNET.cs
File metadata and controls
54 lines (47 loc) · 1.34 KB
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
48
49
50
51
52
53
54
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Diagnostics;
namespaceFireNET
{
publicclassFireNET
{
privateStringroot,current;
privateSystem.Net.HttpWebRequestrequest;
publicFireNET(StringURL,Stringauth=null)
{
current=root=URL;
}
publicStringgetRoot()
{
returnroot;
}
publicStringgetChildren(Stringchild="")
{
request=System.Net.WebRequest.Create(current+child+".json")asSystem.Net.HttpWebRequest;
request.Method="GET";
request.ContentLength=0;
using(varresponse=request.GetResponse()asSystem.Net.HttpWebResponse)
{
using(varreader=newSystem.IO.StreamReader(response.GetResponseStream()))
{
returnreader.ReadToEnd();
}
}
}
publicStringgetChild(Stringchild)
{
returngetChildren(child);
}
publicvoiddescend(Stringchild)
{
current+=child;
}
publicvoidascend(Stringparent)
{
vart=current.LastIndexOf(parent);
current=current.Substring(0,t+parent.Length);
}
}
}