Last active
August 29, 2015 14:14
-
-
Save travcunn/c6496f8d9910fc0f6086 to your computer and use it in GitHub Desktop.
SmartFile create new directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Web; | |
using System.Net; | |
using System.Collections; | |
using SmartFile; | |
namespace SmartFileTest | |
{ | |
class MainClass | |
{ | |
public static int Main (string[] args) | |
{ | |
// Setup new SmartFile client | |
BasicClient api = new BasicClient(); | |
// Data to send in POST request | |
Hashtable p = new Hashtable(); | |
p.Add("path", "newdirectory"); | |
// Create new directory at /newdirectory | |
System.Net.WebResponse r = api.Post("/path/oper/mkdir/", null, p); | |
// Display JSON result of SmartFile API call in the console | |
StreamReader _Answer = new StreamReader(r.GetResponseStream()); | |
Console.WriteLine(_Answer.ReadToEnd()); | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment