public void TestMethod1()
        {
            var filepath =
                @"E:\Github\zbw911\Dev.All\DevLibs\Framework\FileServer\Kt.Framework.FileServer.Test\TestLocalUploadFile.cs";
            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            IUploadFile upload = new LocalUploadFile(key);

            var filekey = "1-2013-12-02-05e89032842c22cc4cb13f07e1173333.cs";
            //var filekey = key.CreateFileKey(filepath);


            Console.WriteLine(filekey);


            var s = key.GetFileSavePath(filekey);


            Console.WriteLine(s);


            Console.WriteLine(Dev.Comm.JsonConvert.ToJsonStr(s));


            var uploadedkey = upload.SaveFile(File.OpenRead(filepath), filekey);

        }
        public void TestMethod1()
        {
            var filepath =
                @"C:\Users\Administrator\Source\Repos\Dev.All\DevLibs\Framework\FileServer\Kt.Framework.FileServer.Test\TestLocalUploadFile.cs";
            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            IUploadFile upload = new LocalUploadFile(key);

            var filekey = key.CreateFileKey(filepath);


            Console.WriteLine(filekey);


            var s = key.GetFileSavePath(filekey);


            Console.WriteLine(s);


            Console.WriteLine(Dev.Comm.JsonConvert.ToJsonStr(s));


            var uploadedkey = upload.SaveFile(File.OpenRead(filepath), filekey);

            //upload.SaveFile(File.OpenRead(".."), filekey);

           



        }
        public void TestDeletePath()
        {
            var skey = "1-2013-12-02-05e89032842c22cc4cb13f07e1173333.cs";
            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            IUploadFile upload = new LocalUploadFile(key);

            upload.DeltePath(skey);
        }
        public void TestFileUrl()
        {
            var skey = "1-2013-12-02-05e89032842c22cc4cb13f07e1173333.cs";
            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            IUploadFile upload = new LocalUploadFile(key);

            var url = key.GetFileUrl(skey);

        }
Beispiel #5
0
        public void CreateNoExtKey()
        {
            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            //var fkey = key.CreateFileKey("filename.cs");
            var fkey = "1-2013-12-02-0a499429af636838f06bbc2af31b65e8";// key.CreateFileKey("filename.cs");

            var strkey = key.CreateFileKey(fkey);
            Console.WriteLine(strkey);
        }
Beispiel #6
0
        public void DelteTest()
        {
            var skey = "1-2013-12-02-0a499429af636838f06bbc2af31b65e8.cs";

            ReadConfig config = new ReadConfig();

            IKey key = new ShareImpl.ShareFileKey();

            IUploadFile uploadfile = new ShareImpl.ShareUploadFile(key);

            uploadfile.DeleteFile(skey);
        }
        public void Register()
        {
            var x = new ReadConfig();

            //公用方法 
            this.Kernel.Bind<IKey>().To<ShareFileKey>();
            this.Kernel.Bind<IUploadFile>().To<ShareUploadFile>();

            //文档类型
            this.Kernel.Bind<IDocFile>().To<DocFileUploader>();
            //图片类型
            this.Kernel.Bind<IImageFile>().To<ImageUploader>();
        }
Beispiel #8
0
        public void TestMethod1()
        {
            ReadConfig config = new ReadConfig();

            IKey key = new ShareImpl.ShareFileKey();

            IUploadFile uploadfile = new ShareImpl.ShareUploadFile(key);

            //var fkey = key.CreateFileKey("filename.cs");
            var fkey = "1-2013-12-02-0a499429af636838f06bbc2af31b65e8.cs";// key.CreateFileKey("filename.cs");
            var filepath =
                @"E:\Github\zbw911\Dev.All\DevLibs\Framework\FileServer\Kt.Framework.FileServer.Test\TestLocalUploadFile.cs";
            var retkey = uploadfile.UpdateFile(File.OpenRead(filepath), fkey);
        }
Beispiel #9
0
        public void TestLocalKey()
        {

            var x = new ReadConfig("TestLocalUploadFile.config");
            IKey key = new LocalFileKey();
            //var fkey = key.CreateFileKey("filename.cs");
            var fkey = "1-2013-12-02-0a499429af636838f06bbc2af31b65e8.cs";// key.CreateFileKey("filename.cs");


            TestValue(key, fkey);




        }
Beispiel #10
0
        public void TestMethod1()
        {
            ReadConfig config = new ReadConfig();

            IKey key = new ShareImpl.ShareFileKey();

            var args = new object[] { "-", "11", "_", "99" };

            var fkey = key.CreateFileKey("zbw911.aspx", "-", "11", "_", "99");

            var url = key.GetFileUrl(fkey, "-", "11", "_", "99");



            var inverseKey = key.GetFileKeyFromFileUrl(url);


            Assert.AreEqual(fkey.Substring(1), inverseKey.Substring(1));
        }
Beispiel #11
0
 static ImageServer()
 {
     var x = new ReadConfig();
 }
Beispiel #12
0
 static FileServer()
 {
     var x = new ReadConfig();
 }