Skip to content

Instantly share code, notes, and snippets.

@travcunn
Last active August 29, 2015 14:14
Show Gist options
  • Save travcunn/c6496f8d9910fc0f6086 to your computer and use it in GitHub Desktop.
Save travcunn/c6496f8d9910fc0f6086 to your computer and use it in GitHub Desktop.
SmartFile create new directory
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