Shell的命名空间是什么 [英] What is the namespace for Shell
本文介绍了Shell的命名空间是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们,
我需要您的帮助,我正在尝试使用C#中的shell方法对文件进行压缩,但是我仍然遇到错误消息,指出Shell名称在当前上下文中不存在.请帮助我,这是我第一次使用此shell方法:((
这是方法:
Shell("C:\\ Program Files \\ WinZip \\ WZZIP.EXE C:\\ Destination DownloadFile");
Guys,
I need your help I''m trying to zip a file using a shell method in C# but I keep on having the error that says The name Shell does not exit in the current context.Please help this is my first time to use this shell method :((
this is the method :
Shell("C:\\Program Files\\WinZip\\WZZIP.EXE C:\\Destination DownloadFile");
推荐答案
System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo();
ps.UseShellExecute = true;
ps.Arguments = "C:\\Destination DownloadFile";
ps.FileName = "C:\\Program Files\\WinZip\\WZZIP.EXE";
System.Diagnostics.Process p = System.Diagnostics.Process.Start(ps);
p.WaitForExit();
您可以在Microsoft.VisualBasic.Compatibility
命名空间中找到Shell,但是您可能还希望研究System.IO.Compression.GZipStream
命名空间,该命名空间提供文件/数据压缩功能.
You can find Shell in theMicrosoft.VisualBasic.Compatibility
namespace, but you may also wish to investigate theSystem.IO.Compression.GZipStream
namespace which provides functionality for file/data compression.
这篇关于Shell的命名空间是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文