使用shell32 dll发布Asp.net

时间:2015-04-13 04:46:59

标签: c# webforms asp.net-webpages shell32.dll

我使用以下代码在几秒钟内获得视频的大小。我使用shell32 dll。当我尝试发布时,dll不在bin文件夹中。一旦我在IIS 7上发布我的项目,我得到一个错误(我想这是因为该DLL不起作用)。我使用的代码是:

Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
                Object shell = Activator.CreateInstance(shellAppType);
                var folder = (Shell32.Folder)shellAppType.InvokeMember("NameSpace",System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { full_path_video });

                Double totallenght=0.0;
                foreach (FolderItem2 item in folder.Items())
                {
                    if (item.Name == newname)
                    {
                        totallenght = item.ExtendedProperty("System.Media.Duration") / 10000000;
                    }
                }

还有其他什么方法可以发布我的项目吗?我尝试通过“添加引用”选项添加dll,在我的本地它工作正常,但在服务器上,它只是不。

0 个答案:

没有答案