Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Problem editing metadata tags using WindowsAPICodePack

$
0
0

Hello,

Is it possible to edit tags programmatically using windowsapicodepack? I tried this code:

private void buttonSaveTags_Click(object sender,EventArgs e)
        {
            if (tagBox.Text != "")
            {
                ShellObject media = ShellObject.FromParsingName(openFileDialog2.FileName);
                var mediaTags = media.Properties.GetProperty(SystemProperties.System.Keywords);
                var tagWriter = media.Properties.GetPropertyWriter();
                tagWriter.WriteProperty(SystemProperties.System.Keywords, tagBox.Text);
                tagWriter.Close(); 
            }
        }
When I run the code through the debugger and try to save a file the compiler returns the error message 'Unable to create shell item.'


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images