本文整理汇总了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);
}
}
示例2: IsolatedStorageDirectory
public IsolatedStorageDirectory(string dirName)
{
_is = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForAssembly();
_dirName = dirName;
_is.CreateDirectory(dirName);
}
示例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);
}
示例4: SelProj
public SelProj()
{
InitializeComponent();
isf = IsolatedStorageFile.GetUserStoreForAssembly();
isf.CreateDirectory("conf");
Refr();
}
示例5: AssemblyStorageService
public AssemblyStorageService()
{
Store = IsolatedStorageFile.GetUserStoreForApplication();
Store.IncreaseQuotaTo(20971520);
if (!Store.DirectoryExists("Modules"))
Store.CreateDirectory("Modules");
}
示例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);
}
示例7: IsolatedStorageResponseCache
public IsolatedStorageResponseCache(TimeSpan expiresIn)
{
this.expiresIn = expiresIn;
storage = IsolatedStorageFile.GetUserStoreForApplication();
if (!storage.DirectoryExists("Cache"))
{
storage.CreateDirectory("Cache");
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例11: ScreenShots
private ScreenShots()
{
_isf = IsolatedStorageFile.GetUserStoreForApplication();
try
{
_isf.CreateDirectory("screenshots");
}
catch
{
// OK the directory already exists.
}
}
示例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++;
}
}
示例13: MainPage
public MainPage()
{
InitializeComponent();
_recorder = new Recorder(new WaveFormat());
_storage = IsolatedStorageFile.GetUserStoreForApplication();
if (!_storage.DirectoryExists(STORAGE_DIRECTORY))
{
_storage.CreateDirectory(STORAGE_DIRECTORY);
}
UpdateRecordings();
}
示例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);
}
}
示例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);
}