work in progress windows UI update

This commit is contained in:
Grant Limberg 2016-11-04 12:39:57 -07:00
parent a7718bae39
commit 4762311977
6 changed files with 93 additions and 8 deletions

View file

@ -107,7 +107,7 @@ namespace WinUI
}
}
public void JoinNetwork(string nwid)
public void JoinNetwork(string nwid, bool allowManaged = false, bool allowGlobal = false, bool allowDefault = false)
{
var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest;
if (request == null)
@ -116,6 +116,17 @@ namespace WinUI
}
request.Method = "POST";
request.ContentType = "applicaiton/json";
using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream()))
{
string json = "{\"allowManaged\":" + (allowManaged ? "true" : "false") + "," +
"\"allowGlobal\":" + (allowGlobal ? "true" : "false") + "," +
"\"allowDefault\":" + (allowDefault ? "true" : "false") + "}";
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{