在csharp中创建一个ram驱动器 [英] creating a ram drive in csharp

查看:70
本文介绍了在csharp中创建一个ram驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在c#中实现了ghostscript应用程序。


我可以通过dllimport导入的Dll函数全部写入磁盘



因为我想要base64编码文件,我不想慢速访问磁盘,

但是要在内存中执行所有功能。


有人能告诉我是否有办法可以创建一个ram

驱动器,我可以写信给它?


At我正在把我的屁股甩掉但却找不到任何东西的那一刻


TIA


Otto

At the moment i am implementing a ghostscript application in c#.

The Dll functions that i can import via dllimport all write to disk
directly.
As i want base64 encode the files, i don''t want the slow disk access,
but do all functions in memory.

Could someone tell me if there is a way in which i can create a ram
drive, which i can write to ??

At the moment i am gooling my butt off but can''t find anything

TIA

Otto

推荐答案

kr ******** @ gmail。 com 写道:
kr********@gmail.com wrote:

有人能告诉我是否有办法可以创建一个ram

驱动器,我可以写信给??
Could someone tell me if there is a way in which i can create a ram
drive, which i can write to ??



如何使用内存映射文件?


Ebbe

How about using memory-mapped files instead?

Ebbe


你好ebbe


我从gsdll32.dll使用以下dll导入


[DllImport(" gsdll32.dll",EntryPoint) =" gsapi_init_with_args")]

private static extern int gsapi_init_with_args(IntPtr instance,int

argc,IntPtr argv);


如您所见,dll使用argcounter和argvalues。值为

,其中包含以下值:


args [0] =" -dNOPAUSE";

args [ 1] =" -dBATCH";

args [2] =" -dSAFER";

args [3] =" -sDEVICE = pdfwrite" ;;

args [4] =" -sOutputFile =" + outputFile;

args [5] = inputFile;


both inputfile和outputfile包含路径或unc。使用任何流类型都没有

功能。

可以通过路径到达内存映射文件。


或内存映射文件只是一种指针我必须通过

从一个应用程序到另一个应用程序???


25日,11: 28,Ebbe Kristensen, < e ... @ ekologic.dkwrote:
Hello ebbe

I use the following dll import from gsdll32.dll

[DllImport("gsdll32.dll", EntryPoint="gsapi_init_with_args")]
private static extern int gsapi_init_with_args (IntPtr instance, int
argc, IntPtr argv);

As you can see the dll uses a argcounter and argvalues. The values are
filled with the following values:

args[0]="-dNOPAUSE";
args[1]="-dBATCH";
args[2]="-dSAFER";
args[3]="-sDEVICE=pdfwrite";
args[4]="-sOutputFile="+outputFile;
args[5]=inputFile;

both inputfile and outputfile contain a path or unc. there is no
functionality for using any stream type''s.
can the memory mapped files be reached by a path.

or are memory mapped files just kind of pointer that i have to pass
from one application to another ???

On 25 jan, 11:28, "Ebbe Kristensen" <e...@ekologic.dkwrote:

krach.a ... @ gmail.com写道:
krach.a...@gmail.com wrote:

有人能告诉我是否有一种方法可以创建一个ram

驱动器,我可以写入?如何使用内存映射文件?
Could someone tell me if there is a way in which i can create a ram
drive, which i can write to ??How about using memory-mapped files instead?



Ebbe


Ebbe


2007年1月25日02:14:46 -0800, kr ******** @ gmail.com 写道:
On 25 Jan 2007 02:14:46 -0800, kr********@gmail.com wrote:

>目前我在c#中实现了ghostscript应用程序。

我可以通过dllimport导入的所有Dll函数都直接写入磁盘

因为我想要base64编码文件,我不想要慢速磁盘访问,但是要在内存中执行所有功能。

有人能告诉我,如果我有办法吗?可以创建一个ram
驱动器,我可以写信给你?

目前我正在关闭我的屁股但却找不到任何东西

TIA

Otto
>At the moment i am implementing a ghostscript application in c#.

The Dll functions that i can import via dllimport all write to disk
directly.
As i want base64 encode the files, i don''t want the slow disk access,
but do all functions in memory.

Could someone tell me if there is a way in which i can create a ram
drive, which i can write to ??

At the moment i am gooling my butt off but can''t find anything

TIA

Otto



DLL函数是写入文件还是写入文件流?如果是一个

文件流,那么你可以通过使用

内存流获得你想要的效果。


DLL - memoryStream -Base64 -disk

rossum

Do the DLL functions write to a file, or to a file stream? If to a
file stream then you might get the effect that you want by using a
memory stream.

DLL -memoryStream -Base64 -disk

rossum


这篇关于在csharp中创建一个ram驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆