当前位置: 首页>>代码示例>>C#>>正文


C# IsolatedStorageFile.CreateDirectory方法代码示例

本文整理汇总了C#中System.IO.IsolatedStorage.IsolatedStorageFile.CreateDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# IsolatedStorageFile.CreateDirectory方法的具体用法?C# IsolatedStorageFile.CreateDirectory怎么用?C# IsolatedStorageFile.CreateDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.IsolatedStorage.IsolatedStorageFile的用法示例。


在下文中一共展示了IsolatedStorageFile.CreateDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyFolderExistsAsync

 private static void VerifyFolderExistsAsync(IsolatedStorageFile isolatedStorageFile)
 {
     if (!isolatedStorageFile.DirectoryExists(MonthFolder))
     {
         isolatedStorageFile.CreateDirectory(MonthFolder);
     }
 }
开发者ID:RRosier,项目名称:GlucoseManager,代码行数:7,代码来源:StorageManager.cs

示例2: IsolatedStorageDirectory

        public IsolatedStorageDirectory(string dirName)
        {
            _is = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForAssembly();

            _dirName = dirName;
            _is.CreateDirectory(dirName);
        }
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:7,代码来源:IsolatedStorageDirectory.cs

示例3: BaseStorageCache

        protected BaseStorageCache(IsolatedStorageFile isf, string cacheDirectory, ICacheFileNameGenerator cacheFileNameGenerator, long cacheMaxLifetimeInMillis = DefaultCacheMaxLifetimeInMillis)
        {
            if (isf == null)
            {
                throw new ArgumentNullException("isf");
            }

            if (String.IsNullOrEmpty(cacheDirectory))
            {
                throw new ArgumentException("cacheDirectory name could not be null or empty");
            }

            if (!cacheDirectory.StartsWith("\\"))
            {
                throw new ArgumentException("cacheDirectory name should starts with double slashes: \\");
            }

            if (cacheFileNameGenerator == null)
            {
                throw new ArgumentNullException("cacheFileNameGenerator");
            }

            ISF = isf;
            CacheDirectory = cacheDirectory;
            CacheFileNameGenerator = cacheFileNameGenerator;
            CacheMaxLifetimeInMillis = cacheMaxLifetimeInMillis;

            // Creating cache directory if it not exists
            ISF.CreateDirectory(CacheDirectory);
        }
开发者ID:mdabbagh88,项目名称:jet-image-loader,代码行数:30,代码来源:BaseStorageCache.cs

示例4: SelProj

        public SelProj()
        {
            InitializeComponent();

            isf = IsolatedStorageFile.GetUserStoreForAssembly();
            isf.CreateDirectory("conf");
            Refr();
        }
开发者ID:kenjiuno,项目名称:ResxLocalizer,代码行数:8,代码来源:SelProj.xaml.cs

示例5: AssemblyStorageService

        public AssemblyStorageService()
        {
            Store = IsolatedStorageFile.GetUserStoreForApplication();
            Store.IncreaseQuotaTo(20971520);
            if (!Store.DirectoryExists("Modules"))
                Store.CreateDirectory("Modules");

        }
开发者ID:Marbulinek,项目名称:NIS,代码行数:8,代码来源:AssemblyStorageService.cs

示例6: CreateDirectoryTree

        public static void CreateDirectoryTree(Uri feedUri, IsolatedStorageFile storage)
        {
            if (!feedUri.OriginalString.Contains('\\')) return;

            var directory = GetDirectoryPath(feedUri);

            if (!storage.DirectoryExists(directory)) 
                storage.CreateDirectory(directory);
        }
开发者ID:GuiBGP,项目名称:qdfeed,代码行数:9,代码来源:SilverlightTestFileLoader.cs

示例7: IsolatedStorageResponseCache

 public IsolatedStorageResponseCache(TimeSpan expiresIn)
 {
     this.expiresIn = expiresIn;
     storage = IsolatedStorageFile.GetUserStoreForApplication();
     if (!storage.DirectoryExists("Cache"))
     {
         storage.CreateDirectory("Cache");
     }
 }
开发者ID:zpinter,项目名称:mobile2-windows7,代码行数:9,代码来源:IsolatedStorageResponseCache.cs

示例8: IsolatedStorageResponseCache

        public IsolatedStorageResponseCache(string session)
        {
            if (session == null) throw new ArgumentNullException("session");
            this._sessionKey = HashUtil.ToSHA1(session);

            //create cache dir
            _storage = IsolatedStorageFile.GetUserStoreForApplication();
            if (!_storage.DirectoryExists("ECollegeCache"))
            {
                _storage.CreateDirectory("ECollegeCache");
            }

            //create session dir
            string thisSessionDirectory = string.Format("ECollegeCache\\{0}", _sessionKey);
            if (!_storage.DirectoryExists(thisSessionDirectory))
            {
                _storage.CreateDirectory(thisSessionDirectory);
            }
        }
开发者ID:PearsonLearningStudio,项目名称:mobile2-windows7,代码行数:19,代码来源:IsolatedStorageResponseCache.cs

示例9: IsolatedStorageCacheItem

        /// <summary>
        /// Instance constructor. Ensures that the storage location in Isolated Storage is prepared
        /// for reading and writing. This class stores each individual field of the CacheItem into its own
        /// file inside the directory specified by itemDirectoryRoot.
        /// </summary>
        /// <param name="storage">Isolated Storage area to use. May not be null.</param>
        /// <param name="itemDirectoryRoot">Complete path in Isolated Storage where the cache item should be stored. May not be null.</param>
        /// <param name="encryptionProvider">Encryption provider</param>
        public IsolatedStorageCacheItem(IsolatedStorageFile storage, string itemDirectoryRoot, IStorageEncryptionProvider encryptionProvider)
        {
            storage.CreateDirectory(itemDirectoryRoot);

            keyField = new IsolatedStorageCacheItemField(storage, "Key", itemDirectoryRoot, encryptionProvider);
            valueField = new IsolatedStorageCacheItemField(storage, "Val", itemDirectoryRoot, encryptionProvider);
            scavengingPriorityField = new IsolatedStorageCacheItemField(storage, "ScPr", itemDirectoryRoot, encryptionProvider);
            refreshActionField = new IsolatedStorageCacheItemField(storage, "RA", itemDirectoryRoot, encryptionProvider);
            expirationsField = new IsolatedStorageCacheItemField(storage, "Exp", itemDirectoryRoot, encryptionProvider);
            lastAccessedField = new IsolatedStorageCacheItemField(storage, "LA", itemDirectoryRoot, encryptionProvider);
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:19,代码来源:IsolatedStorageCacheItem.cs

示例10: CreateDirectoryTree

        /// <summary>
        /// Creates all of the directories included in the given filepath.
        /// </summary>
        /// <param name="filepath">A string containing a filepath which may or may not contain any number of directories.</param>
        /// <param name="storage">A reference to a valid IsolatedStorageFile instance</param>
        public static void CreateDirectoryTree(string filepath, IsolatedStorageFile storage)
        {
            //If this filepath is flat and doesn't contain any folders - bail.
             if (!HasDirectories(filepath)) return;

            //Extract the full directory path from the filename
            var directory = GetFullDirectoryPath(filepath);

            //If the directory doesn't already exist, create it.
            if (!storage.DirectoryExists(directory))
                storage.CreateDirectory(directory);
        }
开发者ID:Aaronontheweb,项目名称:isolatedstorage-extensions,代码行数:17,代码来源:IsolatedStorageHelper.Directory.cs

示例11: ScreenShots

        private ScreenShots()
        {
            _isf = IsolatedStorageFile.GetUserStoreForApplication();

            try
            {
                _isf.CreateDirectory("screenshots");
            }
            catch
            {
                // OK the directory already exists.
            }
        }
开发者ID:sondreb,项目名称:ImageCards,代码行数:13,代码来源:ScreenShots.cs

示例12: CreateDirIfNecessary

        private void CreateDirIfNecessary(IsolatedStorageFile local, string path)
        {
            int pos = 0;
            string dir = path;

            while ((pos = dir.IndexOf('\\', pos)) != -1)
            {
                var dirname = dir.Substring(0, pos);
                if (!local.DirectoryExists(dirname))
                    local.CreateDirectory(dirname);
                pos++;
            }
        }
开发者ID:5nophilwu,项目名称:S1Nyan,代码行数:13,代码来源:IsolatedStorageHelper.cs

示例13: MainPage

        public MainPage()
        {
            InitializeComponent();

            _recorder = new Recorder(new WaveFormat());
            _storage = IsolatedStorageFile.GetUserStoreForApplication();

            if (!_storage.DirectoryExists(STORAGE_DIRECTORY))
            {
                _storage.CreateDirectory(STORAGE_DIRECTORY);
            }

            UpdateRecordings();
        }
开发者ID:jaslong,项目名称:Recorder,代码行数:14,代码来源:MainPage.xaml.cs

示例14: CreateDirectory

 /// <summary>
 /// �ڴ洢���ڴ���Ŀ¼
 /// </summary>
 /// <param name="storage"></param>
 /// <param name="dirName"></param>
 public static void CreateDirectory(IsolatedStorageFile storage, string dirName)
 {
     try
     {
         if (!string.IsNullOrEmpty(dirName) && storage.GetDirectoryNames(dirName).Length > 0)
         {
             storage.CreateDirectory(dirName);
         }
     }
     catch (Exception ex)
     {
         throw new Exception("�޷��ڴ洢���ڴ���Ŀ¼.", ex);
     }
 }
开发者ID:Andy-Yin,项目名称:MY_OA_RM,代码行数:19,代码来源:IsolatedStorageHelper.cs

示例15: IsolatedStorageCacheItem

        /// <summary>
        /// Instance constructor. Ensures that the storage location in Isolated Storage is prepared
        /// for reading and writing. This class stores each individual field of the CacheItem into its own
        /// file inside the directory specified by itemDirectoryRoot.
        /// </summary>
        /// <param name="storage">Isolated Storage area to use. May not be null.</param>
        /// <param name="itemDirectoryRoot">Complete path in Isolated Storage where the cache item should be stored. May not be null.</param>
        /// <param name="encryptionProvider">Encryption provider</param>
        public IsolatedStorageCacheItem(IsolatedStorageFile storage, string itemDirectoryRoot, IStorageEncryptionProvider encryptionProvider)
        {
			if (storage.GetDirectoryNames(itemDirectoryRoot).Length == 0)
			{
				// avoid creating if already exists - work around for partial trust
				storage.CreateDirectory(itemDirectoryRoot);
			}

            keyField = new IsolatedStorageCacheItemField(storage, "Key", itemDirectoryRoot, encryptionProvider);
            valueField = new IsolatedStorageCacheItemField(storage, "Val", itemDirectoryRoot, encryptionProvider);
            scavengingPriorityField = new IsolatedStorageCacheItemField(storage, "ScPr", itemDirectoryRoot, encryptionProvider);
            refreshActionField = new IsolatedStorageCacheItemField(storage, "RA", itemDirectoryRoot, encryptionProvider);
            expirationsField = new IsolatedStorageCacheItemField(storage, "Exp", itemDirectoryRoot, encryptionProvider);
            lastAccessedField = new IsolatedStorageCacheItemField(storage, "LA", itemDirectoryRoot, encryptionProvider);
        }
开发者ID:wuyingyou,项目名称:uniframework,代码行数:23,代码来源:IsolatedStorageCacheItem.cs


注:本文中的System.IO.IsolatedStorage.IsolatedStorageFile.CreateDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。