예제 #1
0
        public DAVOperations(DAVProtocol protocol,
                             String host,
                             int port,
                             String basePath,
                             String username,
                             String password,
                             Func<string, DAVSize> sizeFunc)
        {
            string userHome = Environment.GetEnvironmentVariable("USERPROFILE");
            memfs = new MemFileSystem(userHome + "\\.davfs\\");

            client = new WebdavClient.DAVClient(protocol,
                                                host,
                                                port,
                                                basePath,
                                                username,
                                                password);

            CacheMillis = 30 * 1000;
            FillList("/");

            this.username = username;
            this.password = password;
            this.sizeFunc = sizeFunc;

            Console.WriteLine("This is a beautiful day");
        }
예제 #2
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;
             * }
             */
        }
예제 #3
0
        public DAVOperations(DAVProtocol protocol,
                             String host,
                             int port,
                             String basePath,
                             String username,
                             String password,
                             Func <string, DAVSize> sizeFunc)
        {
            string userHome = Environment.GetEnvironmentVariable("USERPROFILE");

            memfs = new MemFileSystem(userHome + "\\.davfs\\");


            client = new WebdavClient.DAVClient(protocol,
                                                host,
                                                port,
                                                basePath,
                                                username,
                                                password);

            CacheMillis = 30 * 1000;
            FillList("/");

            this.username = username;
            this.password = password;
            this.sizeFunc = sizeFunc;

            Console.WriteLine("This is a beautiful day");
        }
예제 #4
0
파일: Class1.cs 프로젝트: jvd001/DokanDAV
        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;
            }
             */
        }