问题描述
Hello Everyone,
Hello Everyone,
我首先在 - 但是再次在这里重写问题。
I had first posted this on http://forums.asp.net/t/1615658.aspx - but rewriting the problem here again.
我需要提取元数据(所有属性/用户上传的任何文件(可以是pdf,txt,doc,docx,xls,xlsx,jpg等)的System.IO.FileAttributes以外的属性。
I need extract meta-data (all the attributes/properties other than exposed by System.IO.FileAttributes) of any file (could be pdf, txt, doc, docx, xls, xlsx, jpg, etc.) uploaded by the user.
为此,我从MS中找到了dsofile.dll,并从。然后注册了dll并使用了相同的代码,我写了以下代码:
For this I found out dsofile.dll from MS, and downloaded from http://support.microsoft.com/?kbid=224351. Then registered the dll and using the same, I've written following code:
DSOFile.OleDocumentPropertiesClass objFile;
objFile = new DSOFile.OleDocumentPropertiesClass();
objFile.Open(strFile, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
objFile.Close(false);
推荐答案
Dim DSOF As DSOFile.OleDocumentProperties
Dim FName As String
FName =" ; C:\A\Book1.xls" 'works
FName =" C:\A\Book1.xlsm" '不工作
DSOF =新DSOFile.OleDocumentProperties
DSOF.Open FName,True,dsoOptionOpenReadOnlyIfNoWriteAccess
Debug.Print DSOF.SummaryProperties.Author
DSOF.Close
Dim DSOF As DSOFile.OleDocumentProperties
Dim FName As String
FName = "C:\A\Book1.xls" ' works
FName = "C:\A\Book1.xlsm" ' does not work
DSOF = New DSOFile.OleDocumentProperties
DSOF.Open FName, True, dsoOptionOpenReadOnlyIfNoWriteAccess
Debug.Print DSOF.SummaryProperties.Author
DSOF.Close
这篇关于dsofile.dll无法在Windows 7 64位计算机上的VS2008网站中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!