本文整理汇总了C#中Site.GetIsolatedStorage方法的典型用法代码示例。如果您正苦于以下问题:C# Site.GetIsolatedStorage方法的具体用法?C# Site.GetIsolatedStorage怎么用?C# Site.GetIsolatedStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site.GetIsolatedStorage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFile
public void AddFile(Site site, string absoluteFileName, byte[] data)
{
var storage = site.GetIsolatedStorage(_baseDir);
var memoryStream = new MemoryStream();
memoryStream.Write(data, 0, data.Length);
storage.CreateFile(absoluteFileName, memoryStream);
}
示例2: AllFiles
public IEnumerable<SiteFile> AllFiles(Site site, string path)
{
var storage = site.GetIsolatedStorage(_baseDir);
List<SiteFile> list = new List<SiteFile>();
foreach (var item in storage.GetFileNames(path))
{
SiteFile file = new SiteFile()
{
Site = site,
Directory = path,
FileName = item
};
list.Add(file);
}
return list;
}
示例3: DeleteDirectory
public void DeleteDirectory(Site site, string absoluteDirPath)
{
var storage = site.GetIsolatedStorage(_baseDir);
storage.DeleteDirectory(absoluteDirPath);
}
示例4: AllDirectories
public IEnumerable<string> AllDirectories(Site site, string path)
{
var storage = site.GetIsolatedStorage(_baseDir);
return storage.GetDirectoryNames(path);
}
示例5: IsFileExists
public bool IsFileExists(Site site, string absoluteFileName)
{
var storage = site.GetIsolatedStorage(_baseDir);
return storage.FileExists(absoluteFileName);
}
示例6: IsDirectoryExists
public bool IsDirectoryExists(Site site, string dirPath)
{
var storage = site.GetIsolatedStorage(_baseDir);
return storage.DirectoryExists(dirPath);
}
示例7: GetFileData
public byte[] GetFileData(Site site, string absoluteFileName)
{
var storage = site.GetIsolatedStorage(_baseDir);
using (var fileStorage = storage.OpenFile(absoluteFileName, FileMode.Open))
{
var data = fileStorage.Stream.ReadData();
return data;
}
}
示例8: GetFile
public string GetFile(Site site, string absoluteFileName)
{
var storage = site.GetIsolatedStorage(_baseDir);
using (var fileStorage = storage.OpenFile(absoluteFileName, FileMode.Open))
{
var content = fileStorage.Stream.ReadString();
return content;
}
}
示例9: DeleteFile
public void DeleteFile(Site site, string absoluteFileName)
{
var storage = site.GetIsolatedStorage(_baseDir);
storage.DeleteFile(absoluteFileName);
}