首先添加对shell32.dll的引用(一般在c:\windows\system32\shell32.dll)
Shell32.Shell s = new Shell32.Shell();//其中Shell是一个接口,这句居然不报错,汗
另外,关于shell32.dll还有一个问题:
网上有篇文章《c#使用系统函数System.Shell.Folder.copyHere解压.zip文件》,地址在
http://hi.baidu.com/jcleung/blog/item/1e76e2ed86408ddcb31cb19b.html我试了,这个方法根本不行,大家试试:
        private void button1_Click(object sender, EventArgs e)
        {            UnZip("c:\\my.zip", "c:\\destdir");//我的电脑上存在这个目录c:\destdir
        }        static void UnZip(string zipFile, string destFolder)
        {
            Shell32.ShellClass sc = new Shell32.ShellClass();
            Shell32.Folder SrcFolder = sc.NameSpace(zipFile);
            Shell32.Folder DestFolder = sc.NameSpace(destFolder);
            Shell32.FolderItems items = SrcFolder.Items();