TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Henry Lasher
NA
24
733
Getting null when reading extended tags on a TIF file.
May 8 2019 8:50 PM
string
tag = GetExtendedFileAttribute(@
"file path goes here"
,
"Tags"
);
public
static
string
GetExtendedFileAttribute(
string
filePath,
string
propertyName)
{
string
retValue =
null
;
Type shellAppType = Type.GetTypeFromProgID(
"Shell.Application"
);
object
shell = Activator.CreateInstance(shellAppType);
Shell32.Folder folder = (Shell32.Folder)shellAppType.InvokeMember(
"NameSpace"
, System.Reflection.BindingFlags.InvokeMethod,
null
, shell,
new
object
[] { @
"C:\Windows\System32"
});
int
? foundIdx =
null
;
for
(
int
i = 0; i <
short
.MaxValue; i++)
{
string
header = folder.GetDetailsOf(
null
, i);
Console.WriteLine(header);
if
(header == propertyName)
{
foundIdx = i;
break
;
}
}
if
(foundIdx.HasValue)
{
foreach
(FolderItem2 item
in
folder.Items())
{
if
(item.Name.ToUpper() == System.IO.Path.GetFileName(filePath).ToUpper())
{
retValue = folder.GetDetailsOf(item, foundIdx.GetValueOrDefault());
break
;
}
}
}
return
retValue;
}
Reply
Answers (
1
)
How to read a Temperature for August and get the total Aveg
Convert CSV to datatable