public static void Main() { DAVClient client = new DAVClient(DAVProtocol.HTTP, "test-ddv1.racsa.co.cr", 80, "/DDV/webdav/repo1/java", "iamedu", "iamedu"); /* * List<DAVFileInfo> list = client.List("/"); * * foreach(DAVFileInfo info in list) { * Console.WriteLine(info.Name); * } */ client.CreateFolder("/iamedu/muerete"); Console.WriteLine("Finished everything"); Console.Read(); /* * DokanOptions opt = new DokanOptions(); * opt.MountPoint = "n:\\"; * opt.DebugMode = true; * opt.VolumeLabel = "DDV"; * * int status = DokanNet.DokanMain(opt, new DAVOperations(DAVProtocol.HTTP, * "localhost", * 8080, * "/repository/default", * "admin", * "admin", * null)); * * switch (status) * { * case DokanNet.DOKAN_DRIVE_LETTER_ERROR: * Debug.WriteLine("Drive letter error"); * break; * case DokanNet.DOKAN_DRIVER_INSTALL_ERROR: * Debug.WriteLine("Drive install error"); * break; * case DokanNet.DOKAN_MOUNT_ERROR: * Debug.WriteLine("Mount error"); * break; * case DokanNet.DOKAN_START_ERROR: * Debug.WriteLine("Start error"); * break; * case DokanNet.DOKAN_ERROR: * Debug.WriteLine("Unknown error"); * break; * case DokanNet.DOKAN_SUCCESS: * Debug.WriteLine("Success"); * break; * default: * Debug.WriteLine("Unknown status: %d", status); * break; * } */ }
public int CreateDirectory(string filename, DokanFileInfo info) { string webFilename = Normalize(filename); try { if (memfs.Exists(webFilename)) { return(-DokanNet.ERROR_FILE_EXISTS); } if (client.CreateFolder(webFilename)) { memfs.CreateDirectory(webFilename); } else { return(-DokanNet.ERROR_ACCESS_DENIED); } } catch (Exception ex) { Console.WriteLine(ex); return(-1); } return(0); }
public static void Main() { DAVClient client = new DAVClient(DAVProtocol.HTTP, "test-ddv1.racsa.co.cr", 80, "/DDV/webdav/repo1/java", "iamedu", "iamedu"); /* List<DAVFileInfo> list = client.List("/"); foreach(DAVFileInfo info in list) { Console.WriteLine(info.Name); } */ client.CreateFolder("/iamedu/muerete"); Console.WriteLine("Finished everything"); Console.Read(); /* DokanOptions opt = new DokanOptions(); opt.MountPoint = "n:\\"; opt.DebugMode = true; opt.VolumeLabel = "DDV"; int status = DokanNet.DokanMain(opt, new DAVOperations(DAVProtocol.HTTP, "localhost", 8080, "/repository/default", "admin", "admin", null)); switch (status) { case DokanNet.DOKAN_DRIVE_LETTER_ERROR: Debug.WriteLine("Drive letter error"); break; case DokanNet.DOKAN_DRIVER_INSTALL_ERROR: Debug.WriteLine("Drive install error"); break; case DokanNet.DOKAN_MOUNT_ERROR: Debug.WriteLine("Mount error"); break; case DokanNet.DOKAN_START_ERROR: Debug.WriteLine("Start error"); break; case DokanNet.DOKAN_ERROR: Debug.WriteLine("Unknown error"); break; case DokanNet.DOKAN_SUCCESS: Debug.WriteLine("Success"); break; default: Debug.WriteLine("Unknown status: %d", status); break; } */ }