Get resource path

Kohedlo

07-06-2010 21:26:28

How to get resource full path - in ResourceGroupManager.OpenResource7. Data stream have name of resource but i not find how to recive full path.

smiley80

10-06-2010 00:04:41

public string GetFullPath(string resGroup, string resName)
{
using (FileInfoListPtr res = ResourceGroupManager.Singleton.FindResourceFileInfo(resGroup, resName))
{
if (res != null && res.Count > 0)
{
FileInfo_NativePtr fi = res[0];
switch (fi.archive.Type.ToUpperInvariant())
{
case "FILESYSTEM":
return Path.GetFullPath(Path.Combine(fi.archive.Name, fi.filename));
default:
throw new NotImplementedException();
}
}
}

return null;
}