想要使用C#.net桌面应用程序在Windows 7中调用碎片整理过程 [英] Want to call Defragment Process in Windows 7 using C#.net Desktop Application
本文介绍了想要使用C#.net桌面应用程序在Windows 7中调用碎片整理过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过visual studio 2010 C#.net在Windows7中打开磁盘碎片整理窗口。
我使用此代码
Process.Start(dfrgui); //'dfrgui'用于在Windows 7中打开磁盘碎片整理窗口
但该窗口不会出现。
但是在windows xp中我使用
Process.Start(dfrg.msc);
这里出现了窗口。
还有其他方法可以在Windows 7中调用碎片整理程序吗?
解决方案
您应该可以通过wmi执行此操作: http://msdn.microsoft.com/en-us/library/windows/desktop/aa389832(v = vs.85).aspx [ ^ ]
在项目设置中将用于构建项目的目标平台从x86更改为AnyCPU。这对我有用。
我试过但没有什么工作
请有人发给我asif的方式。 2010.ansari@gmail.com
I want to open disk defragment window in Windows7 by visual studio 2010 C# .net .
there i use this code
Process.Start("dfrgui"); // 'dfrgui' is used to open disk defragment window in windows 7
but that Window does not appear .
but in windows xp i use
Process.Start("dfrg.msc");
here the window is appear .
is there any another way to call defragmenter in windows 7 ?
解决方案
You should be able to do it via wmi: http://msdn.microsoft.com/en-us/library/windows/desktop/aa389832(v=vs.85).aspx[^]
Change your Target Platform for building the project from "x86" to "AnyCPU" in the project settings. This worked for me.
i tried but nothing is working
please anyone send me the way to do it at asif.2010.ansari@gmail.com
这篇关于想要使用C#.net桌面应用程序在Windows 7中调用碎片整理过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文