Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
Sorry about the tags, I couldn't add more, but they are actually, "Shell32", "Crash", "Error" –  Kourosh Sep 22 '11 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 '11 at 9:53
    
What is column 21? –  Warwick Allison Sep 22 '11 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 '11 at 10:35
1  
Try using System.Diagnosics.FileVersionInfo (msdn.microsoft.com/en-us/library/91sft6af.aspx) –  Nevermind Sep 22 '11 at 12:45

2 Answers 2

Using Shell32 isn't portable.

Have you tried using the .net equivalents?

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

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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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