需要备份磁盘的例子.... [英] Need example of backing up disk....

查看:51
本文介绍了需要备份磁盘的例子....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得一些.net示例代码,向我展示如何将硬盘驱动器(如我的C:驱动器)完整备份到另一个位置(比如说我的D) :

驱动器)而C:驱动器正在使用中。


基本上,我想制作并赠送免费备份软件,因为

Acronis给了我很多问题。


我们非常感谢您提供的任何帮助或链接。 (请

包括您的姓名,以便在免费的

申请表中添加到学分页面。)


jim

I''d like to get some .net sample code that shows me how to make a complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.

Basically, I''d like to make and give away free backup software because
Acronis has given me so many problems.

Any help or links you could provide would be greatly appreciated. (Please
include your name to be added to the credits screen in the free
application.)

jim

推荐答案

请不要如此宽松地交叉发帖。在两个不同的语言组之间进行交叉发布是特别不合适的。如果您真的想要与语言无关的建议,请选择一个非语言特定的新闻组(例如

m.p.d.framework)并在那里发布您的问题。 (C#

新闻组的后续行动)


至于你的具体问题:


On Thu,22 2008年5月16:21:08 -0700,jim< ji*@home.netwrote:
Please don''t cross-post so liberally. It is especially inappropriate to
cross-post between two different language groups. If you really want
language-agnostic advice, pick a non-language-specific newsgroup (like
m.p.d.framework) and post your question there. (follow-ups to C#
newsgroup)

As for your specific question:

On Thu, 22 May 2008 16:21:08 -0700, jim <ji*@home.netwrote:

我想得到一些显示的.net示例代码我如何完成

完成

备份硬盘(如我的C:驱动器)到另一个位置(比如我的D:

当C:驱动器正在使用时。
I''d like to get some .net sample code that shows me how to make a
complete
backup of a hard drive (like my C: drive) to another location (say my D:
drive) while the C: drive is in use.



毫无疑问,有很多不同的方法可以解决这个问题。

然而,假设你只是想做一个简单的逐个文件传输,

你可能想看看System.IO中的类,包括File和

目录。那些支持操作,比如枚举文件系统中的文件和

目录,并将文件从一个地方复制到另一个地方




您对驱动器正在使用时的规定使事情变得复杂,因为文件可能正在被使用,因此无法复制
,因此需要
。解决这个问题的一种方法是维护你遇到的

文件列表,然后再试一次。对于一些

的程度来说,这是一个无法解决的问题,所以我不确定它是否值得为b / b $ b做更复杂的事情。事实上,您可能只是想要向用户报告并将其留在那里。


如果您打算将文件存档到一个大的文件,然后你

也可能想看看像FileStream和GZipStream这样的类(

后者,试图压缩输入...如果你有很多

可压缩文件,如HTML,XML等,然后这个可选功能可能值得查看。


恕我直言,不需要给予信任。新闻组适用于所有人,并免费提供

建议。通过在这里提出一个问题,你可以像其他人一样帮助别人,因为其他人可能会在以后找到同样的问题来回答

。一个人将不得不投入更多的精力而不仅仅是在新闻组中回答一个快速问题,以保证在某些特定软件中记入.b
。否则,根据该指标,我怀疑我们的一些数字是否因为帮助选择相当广泛的b
而被遗漏(至少有十几个经常

的人在这里回答非常重要的问题,可能还有一两个人不经常这么做,据我所知,我们都没有明确地说过

记入正在开发的最终产品中)。 :)


Pete

No doubt there''s lots of different approaches to something like this.
However, assuming you''re just going to do a simple file-by-file transfer,
you might want to look at the classes in System.IO, including File and
Directory. Those support operations like enumerating the files and
directories in the file system, and copying a file from one place to
another.

Your stipulation of "while the drive is in use" complicates things,
because of the possibility that a file may be in use and thus not able to
be copied. One approach to dealing with that is to maintain a list of
files that you come across like that, and try them again later. To some
extent it''s an unresolvable problem, so I''m not sure it''d be worthwhile to
do anything more complicated than that. In fact, you may simply just want
to report to the user and leave it at that.

If you are intending to archive files into a single large file, then you
may also want to look at classes like FileStream and GZipStream (the
latter for making an attempt to compress the input...if you have a lot of
compressible files, like HTML, XML, etc. then this optional feature might
be worth looking into).

No need to give credit, IMHO. The newsgroup is available for all, with
advice given freely. By asking a question here, you help others as much
as yourself, as someone else may later come looking for the answer to the
same question. A person would have to invest a lot more effort than just
answering a quick question in the newsgroup to warrant being credited in
some specific software. Otherwise, by that metric I suspect that a number
of us are being left out being credited for helping with a fairly broad
selection of programs (there are at least a dozen people who regularly
answer non-trivial questions here, and probably another dozen or two who
do so infrequently, and as far as I know, none of us are ever explicitly
credited in whatever final product was being developed). :)

Pete


Jim,


我不觉得任何版本的VB都是正确的程序语言,如

其实不是任何托管语言。


也许原始C可以帮助你或英特尔汇编程序。


只是我的意见,


Cor


" jim" < ji*@home.netschreef in bericht

news:oc ***************** @ bignews5.bellsouth.net ...
Jim,

I don''t think that any version of VB is the right programma language, as in
fact not any managed language.

Maybe raw C can help you or otherwise Intel Assembler.

Just my opinion,

Cor

"jim" <ji*@home.netschreef in bericht
news:oc*****************@bignews5.bellsouth.net...

我想得到一些.net示例代码,向我展示如何对硬盘进行完整的

备份(比如我的C) :驱动器)到另一个位置(比如我的D:

驱动器),而C:驱动器正在使用中。


基本上,我想要制作并赠送免费备份软件因为

Acronis给了我很多问题。


我们非常感谢您提供的任何帮助或链接。 (请

包括您的姓名,以便在免费的

申请表中添加到学分页面。)


jim


所以你想制作一个你不知道如何做得更好的软件

那么实际上相对稳定的Acronis?我很失落你的逻辑......


" jim" < ji*@home.netWrote in message

news:oc ***************** @ bignews5.bellsouth.net ...
So you want to make software that you do not know how to make to be better
then Acronis which is actually relatively stable? im so lost on your logic..

"jim" <ji*@home.netwrote in message
news:oc*****************@bignews5.bellsouth.net...

我想得到一些.net示例代码,向我展示如何对硬盘进行完整的

备份(比如我的C) :驱动器)到另一个位置(比如我的D:

驱动器),而C:驱动器正在使用中。


基本上,我想要制作并赠送免费备份软件因为

Acronis给了我很多问题。


我们非常感谢您提供的任何帮助或链接。 (请

包括您的姓名,以便在免费的

申请表中添加到学分页面。)


jim



这篇关于需要备份磁盘的例子....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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