如何以编程方式创建分区? [英] How to programmatically create a partition?

查看:85
本文介绍了如何以编程方式创建分区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在我目前的一个项目中,我愿意创建一个安全区域,例如

Acronis在其应用程序中存储一些保密信息

当前机器用户可以访问。


我知道.Net没有提供这样的功能因此我继续

MSDN Library以及谷歌寻找任何没有结果的解决方案...

我首先猜测使用WMI它可能是可行的(System.Management

名称空间)但它只提供了一种检索信息的方法...


然后我看了互操作但我找不到任何可以做<的库br />
给我的工作......


现在,我的问题是,您猜测我的处理这个

功能的原因是什么?程序...?我不在乎是否必须用

非托管代码编写,因为我当前的客户端用户绑定到Windows

环境......


谢谢


Amadrias

解决方案

" Amadrias" <上午****** @ discussions.microsoft.com>写道:



在我目前的一个项目中,我愿意创建一个安全区域,例如
Acronis在其应用程序中所做的存储一些只有当前机器用户可以访问的机密信息。

我知道.Net没有提供这样的功能因此我继续使用MSDN Library以及谷歌寻找没有结果的任何解决方案...


您是否查看了隔离存储?


隔离存储
http://msdn.microsoft.com/library/de...tedStorage.asp


使用自定义管理.NET应用程序中的用户设置

首选项API"
http://msdn.microsoft.com/msdnmag/is .. .ompreferences /

这也可能是有意义的:


如何创建DPAPI库
http://msdn.microsoft .com / library / de ... secnetht07.asp

我首先猜到使用WMI它可能是可行的(System.Management
命名空间)但它只提供了一种检索信息的方法...

然后我看了互操作但我找不到任何可以为我做工作的图书馆......

现在,我的问题是,你在我的程序中处理这个
功能的想法是什么?我不在乎是否必须用非托管代码编写,因为我当前的客户端用户绑定到Windows
环境......

谢谢
< Amadrias




''任何傻瓜都可以编写计算机可以理解的代码。

优秀的程序员编写人类可以理解的代码。 ''

Martin Fowler,

''重构:改进现有代码的设计'',第15页


< blockquote>首先感谢您的快速回答...


不幸的是,这与我的客户要求不符:


关于存储location,我知道IsolatedStorage可以为我提供一个很好的存储偏好数据的地方。现在,这并没有提供一个真正安全的

区域,就像你是一个管理员一样,你仍然可以访问

隔离存储位置并操纵文件是我的

客户端不希望他们能够做到的。


我能满足客户要求的独特方式是以编程方式

在硬盘驱动器上创建一个新分区,或者甚至在可移动存储中创建一个新分区,然后

然后,让这个分区不能用于windows ...


我需要一手这个部分...


谢谢,


Amadrias


UAError写道:

" Amadrias" <上午****** @ discussions.microsoft.com>写道:



在我目前的一个项目中,我愿意创建一个安全区域,例如
Acronis在其应用程序中所做的存储一些只有当前机器用户可以访问的机密信息。

我知道.Net没有提供这样的功能因此我继续使用MSDN Library以及谷歌寻找没有结果的任何解决方案......



你有没看过隔离存储?

隔离存储
http:/ /msdn.microsoft.com/library/de...tedStorage.asp

使用自定义
首选项API管理.NET应用程序中的用户设置
http://msdn.microsoft.com/msdnmag /is...omprefere nces /

这也可能是有意义的:

如何创建DPAPI库
http://msdn.microsoft.com/library/ de ... secnetht07.asp

我首先猜到使用WMI它可能是可行的(System.Management
命名空间)但它只是提供了一种检索信息的方法......

然后我看了互操作,但我找不到任何可以为我做工作的图书馆......

现在,我的问题是,你在我的程序中处理这个
功能的想法是什么?我不在乎是否必须用非托管代码编写,因为我当前的客户端用户绑定到Windows
环境......

谢谢
< Amadrias



''任何傻瓜都可以编写计算机可以理解的代码。
优秀的程序员编写人类可以理解的代码。''
Martin Fowler ,''重构:改进现有代码的设计'',第15页



只是为了添加一些信息...


我找到了一个开源项目,它提供了我想要的功能:

寻找:
http://truecrypt.sourceforge.net/


然而,整体是编译在单个.exe文件中,而不是作为一个

..dll共享,因此我可以在我的项目中导入...


Amadrias

" Amadrias"写道:

首先感谢您的快速回答......

不幸的是,这与我的客户要求不符:
在存储位置,我知道IsolatedStorage可以为我提供存储首选项数据的好地方。现在,这并没有提供一个真正安全的区域,就好像你是一个管理员,你仍然可以访问孤立的存储位置并操纵文件,这是我的客户端我不希望他们能够做到。

我能满足客户要求的独特方式是以编程方式在硬盘驱动器上甚至在可移动存储中创建新分区然后,让这个分区不能用于Windows ......

我需要一手这个部分...

谢谢,

Amadrias

UAError写道:

" Amadrias" <上午****** @ discussions.microsoft.com>写道:



在我目前的一个项目中,我愿意创建一个安全区域,例如
Acronis在其应用程序中所做的存储一些只有当前机器用户可以访问的机密信息。

我知道.Net没有提供这样的功能因此我继续使用MSDN Library以及谷歌寻找没有结果的任何解决方案......



你有没看过隔离存储?

隔离存储
http:/ /msdn.microsoft.com/library/de...tedStorage.asp

使用自定义
首选项API管理.NET应用程序中的用户设置
http://msdn.microsoft.com/msdnmag /is...omprefere nces /

这也可能是有意义的:

如何创建DPAPI库
http://msdn.microsoft.com/library/ de ... secnetht07.asp

我首先猜到使用WMI它可能是可行的(System.Management
命名空间)但它只是提供了一种检索信息的方法......

然后我看了互操作,但我找不到任何可以为我做工作的图书馆......

现在,我的问题是,你在我的程序中处理这个
功能的想法是什么?我不在乎是否必须用非托管代码编写,因为我当前的客户端用户绑定到Windows
环境......

谢谢
< Amadrias



''任何傻瓜都可以编写计算机可以理解的代码。
优秀的程序员编写人类可以理解的代码。''
Martin Fowler ,
''重构:改进现有代码的设计'',第15页



Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn''t provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn''t find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don''t care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias

解决方案

"Amadrias" <Am******@discussions.microsoft.com> wrote:

Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn''t provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...
Did you check out isolated storage?

"Isolated Storage"
http://msdn.microsoft.com/library/de...tedStorage.asp

"Manage User Settings in Your .NET App with a Custom
Preferences API"
http://msdn.microsoft.com/msdnmag/is...ompreferences/
this may also be of interest:

How To Create a DPAPI Library
http://msdn.microsoft.com/library/de...secnetht07.asp

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn''t find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don''t care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias



''Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.''
Martin Fowler,
''Refactoring: improving the design of existing code'', p.15


First thanks for this quick answer...

Unfortunatelly, this doesn''t match my client requirements:

On the storage location, I knew that IsolatedStorage could provide me a good
place to store preferences data. Now, this doesn''t provide a real secured
zone as if you are an administrator, you still can have access to the
isolated storage locations and manipulate the files which is something my
client doesn''t want them to be able to do.

The unique way I can answer my client requirements is to programmatically
create a new partition on a hard drive or even in a removable storage and
then, make this partition not available to windows...

And I need a hand on this part...

Thanks,

Amadrias

"UAError" wrote:

"Amadrias" <Am******@discussions.microsoft.com> wrote:

Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn''t provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...



Did you check out isolated storage?

"Isolated Storage"
http://msdn.microsoft.com/library/de...tedStorage.asp

"Manage User Settings in Your .NET App with a Custom
Preferences API"
http://msdn.microsoft.com/msdnmag/is...ompreferences/
this may also be of interest:

How To Create a DPAPI Library
http://msdn.microsoft.com/library/de...secnetht07.asp

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn''t find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don''t care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias



''Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.''
Martin Fowler,
''Refactoring: improving the design of existing code'', p.15



Just to add some information...

I''ve found an open source project that provides the kind of features I am
looking for:
http://truecrypt.sourceforge.net/

However, the overall is compiled in a single .exe file and not shared as a
..dll that I could therefore import within my project...

Amadrias

"Amadrias" wrote:

First thanks for this quick answer...

Unfortunatelly, this doesn''t match my client requirements:

On the storage location, I knew that IsolatedStorage could provide me a good
place to store preferences data. Now, this doesn''t provide a real secured
zone as if you are an administrator, you still can have access to the
isolated storage locations and manipulate the files which is something my
client doesn''t want them to be able to do.

The unique way I can answer my client requirements is to programmatically
create a new partition on a hard drive or even in a removable storage and
then, make this partition not available to windows...

And I need a hand on this part...

Thanks,

Amadrias

"UAError" wrote:

"Amadrias" <Am******@discussions.microsoft.com> wrote:

Hi,

In one of my current projects, I am willing to create a secure zone such as
Acronis does in its application to store some confidential information only
accessible to the current machine user.

I know that .Net doesn''t provide such functionalities therefore I went on
MSDN Library and also on Google to look for any solution with no result...



Did you check out isolated storage?

"Isolated Storage"
http://msdn.microsoft.com/library/de...tedStorage.asp

"Manage User Settings in Your .NET App with a Custom
Preferences API"
http://msdn.microsoft.com/msdnmag/is...ompreferences/
this may also be of interest:

How To Create a DPAPI Library
http://msdn.microsoft.com/library/de...secnetht07.asp

I first guessed that using WMI it could be doable (System.Management
namespace) but it only provides a way to retrieve information...

I then looked at interop but I couldn''t find any library that could do the
job for me...

Now, comes my question, what would be your guess to handle this
functionality in my program...? I don''t care if it has to be written in
unmanaged code as my current client users are binded to Windows
environments...

Thanks

Amadrias



''Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.''
Martin Fowler,
''Refactoring: improving the design of existing code'', p.15



这篇关于如何以编程方式创建分区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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