请问如何在内存中建立一虚拟盘或者虚拟文件夹?(50分)

  • 主题发起人 主题发起人 foxgirl
  • 开始时间 开始时间
F

foxgirl

Unregistered / Unconfirmed
GUEST, unregistred user!
要求这个虚拟文件夹或者盘与硬盘上的文件夹在操作上完全一样,谢了
 
没接触过这方面的东西, 应该是要写驱动程序吧?
 
不是要写驱动程序,想替代stream操作
 
unit Subst;

{
API for work with substitution device (see dos command "subst").
Win 9x/NT/2000/XP compatible
ver. 1.2 Last rev. 25 Feb 2002

Freware with source.

Copyright (c) 2000-2002, SoftLab MIL-TEC Ltd
Web: http://www.softcomplete.com
Email: support@softcomplete.com

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED
"AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR
ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.
NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
THE USER MUST ASSUME THE ENTIRE RISK OF USING THE ACCOMPANYING CODE.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented, you must
not claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. Original copyright may not be removed or altered from any source
distribution.
}

interface

uses Windows, SysUtils;

function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
// create subst device. Path must be a real folder.

function SubstRemove(DriveLetter: Char): Boolean;
// destroy subst device.

function SubstQuery(DriveLetter: Char): string;
// get Path for subst device.
// return empty string if DriveLetter is not subst-device

implementation

procedure VxDCall; external kernel32 index 1;

function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
var drvno: byte;
buff: array[0..256] of char;
FPath: string;

function AddSlash(const Path: string): string; {漕徉怆
 
谢楼上的sephil朋友,可惜看不懂啊,也不知道怎么用...........
:((((((((
 
替代stream操作? 还以为你想做一个内存虚拟磁盘的软件呢
到底你要实现什么样的目的?
 
呵呵,这个软件不错哦
http://www.skycn.com/soft/8345.html

AR RAM Disk V1.20
软件介绍:
AR RAM Disk 可以利用内存模拟技术产生一个附加的硬盘,你可以把它用来写入临时文件等等,以提高系统的运行速度。
 
xianjun:我是想在内存中虚拟文件夹,这样频繁访问时比较快。
LiChaoHui:可我要的是代码,不是软件啊
 
那你自己写驱动程序吧,人家都是写好的了
你可以和作者联系一下,看怎么调用他的驱动模块
 
给历史遗留问题结贴
 
后退
顶部