最近想做一个类似于浏览器的程序,这个程序有一个要求是程序不能随意对磁盘文件进行操作(安全方面考虑),因此我的想法就是提供一个类似于crt的库,这个库将crt里面的文件操作函数进行了重写,使得对文件的操作最终只是操作一个目录或文件。以前也有人有这个需求,他将这个叫做独立文件系统,我就按这个进行搜索,结果没找到类似的开源工程(自己动手之前先看看别人有没有做过,免得重造轮子)。最近我在csdn论坛发帖(http://topic.csdn.net/u/20091225/19/2b4add83-7166-46a1-9673-735452cf9c17.html?56464),有人回帖了filedisk,这个是一个好东西,去并不满足我的需求。
最近在网上找东西时,无意间看到了Silverlight里面的IsolatedStorage,这个东西c#里面也可以用。IsolatedStorage基本满足我的需求,不过我最先要的是c/c++版本。不过没什么关系,我有办法在c/c++里面使用.net里面的这些类。
下面贴一段IsolatedStorage的介绍(http://ajava.org/readbook/webkf/silverlightzn/17379.html):
14.2 独立存储IsolatedStorage 独立存储(IsolatedStorage)是Silverlight 2中提供的一个客户端安全的虚拟文件系统。由于Silverlight限制了客户端Silverlight应用程序不能访问文件系统,只能通过独立存储机制提供虚拟文件系统,访问数据流对象。 Silverlight中的独立存储有以下一些特征。 · 跟Cookie机制类似,独立存储是一个局部信任机制。在独立存储空间内可以放置任意类型的文件,如XML文件、TXT文件、图片、视频等。 · 每个Silverlight应用程序都被分配了属于它自己的独立存储空间。如果应用程序中存在多个程序集,那么存储空间在这多个程序集之间是共享的。 · 独立存储支持使用File和Directory等类访问和维护文件或文件夹。 · 独立存储严格地限制了应用程序可以存储的数据的大小。在默认情况下,每个应用程序的独立存储空间上限为1MB。 14.2.1 使用独立存储 Silverlight中的独立存储功能是通过IsolatedStorageFile来提供的。 IsolatedStorageFile类位于命名空间System.IO.IsolatedStorag中,它抽象了独立存储的虚拟文件系统。使用 IsolatedStorageFile可以对文件或文件夹进行创建和管理。管理文件内容可以使用IsolatedStorageFile类的 IsolatedStorageFileStream对象。 |
微软msdn对IsolatedStorage的解释:
http://msdn.microsoft.com/zh-cn/library/system.io.isolatedstorage.isolatedstoragefilestream_members(VS.80).aspx
filedisk网站上有一些实用的东西,有源码,可以参考一下实现:
Ntifs.h-56 Updated so you can compile Matt Wu's ext2fsd with it. SwapFs-2.1 Works with swap partitions bigger than 4GB,works on 64-bit systems. FileDisk-17 Allow to mount images without administrative privileges by Konstantin Vlasov,works better on Windows Vista and Windows 7,support for 64-bit systems. @L_404_7@ Allow to mount images without administrative privileges by Konstantin Vlasov,support for 64-bit systems. Khttpd-2 Simple kernel mode web server for Windows that demonstrates how to do network communication from kernel mode and how to use the MDL interface to the filesystem. Rfsd-0.25.5 I have updated the unmaintained ReiserFs file system driver so that it works on newer versions of Windows. Ext2fsd-new Fix for BSOD on Windows 7. |
C++调用C#生成的DLL
Call C# Code from C++ and read an array of struct which contains strings
如何从 Visual Studio.NET 中或在 Visual Studio 2005 中的本机 Visual c + + 代码调用托管的 DLL
在suanyuan的提示下,我觉得Virtual File system才是我要找的东西,大家可以去http://en.wikipedia.org/wiki/Virtual_file_system看看Virtual File system的介绍。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。