up vote 0 down vote favorite
share [fb]

I'm using shell 32 to get some file descriptions. It works perfect in Visual Studio 2010, but when it comes inside unity3d it crashes.

The code is:

using Shell32;

ShellClass shell = new ShellClass();
Folder objFolder = shell.NameSpace(path);

string fileTitle = objFolder.GetDetailsOf(objFolder.Items().item(0),21); //Crash on this line

I appreciate your help.

link|improve this question
Sorry about the tags, I couldn't add more, but they are actually, "Shell32", "Crash", "Error" – Kourosh Sep 22 at 7:39
1  
Do you have to use Shell32? It won't of course work on Mac, iOS, Android, or the WebPlayer. – Warwick Allison Sep 22 at 9:53
What is column 21? – Warwick Allison Sep 22 at 9:56
I'm writing a plugin, it won't need to be there for compile. just using inside the editor... 21 will return the title – Kourosh Sep 22 at 10:35
1  
Try using System.Diagnosics.FileVersionInfo (msdn.microsoft.com/en-us/library/91sft6af.aspx) – Nevermind Sep 22 at 12:45
show 3 more comments
feedback

2 Answers

Using Shell32 isn't portable.

Have you tried using the .net equivalents?

http://msdn.microsoft.com/en-us/library/system.io.filesysteminfo.aspx

link|improve this answer
Thanks Tetrad, I looked into it. It won't give access to details tab. – Kourosh Sep 22 at 16:12
feedback

Yes, use the System.IO; namespace

there you have multiple interesting methods like

File.Exists(...) Directory.Exists( ...) Path.GetDirectoryName(...) Path.Combine(path, filename) Path.GetFileNameOnly(...)

( note: the method I wrote are not exactly correctly named, but you get the picture) :)

Cheers T.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.