示例#1
0
        public static void CreateNewFile(IFileStorageProviderDataProvider dataProvider, Guid physicalFileID, string extensionName)
        {
            IFileStorageProvider provider = FileStorageProviderFactory.CreateFileStorageProvider(dataProvider, CurrentConfigSetting, physicalFileID, extensionName);

            if (provider != null)
            {
                try
                {
                    provider.SetLength(0);
                }
                finally
                {
                    provider.Close();
                }
            }
        }
示例#2
0
        public static void SetFileLength(IFileStorageProviderDataProvider dataProvider, Guid physicalFileID, string extensionName, long length)
        {
            IFileStorageProvider provider = FileStorageProviderFactory.CreateFileStorageProvider(dataProvider, physicalFileID, extensionName);

            if (provider != null)
            {
                try
                {
                    provider.SetLength(length);
                }
                finally
                {
                    provider.Close();
                }
            }
        }