|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WMFMetadataReader
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
openFileDialog1.InitialDirectory = "c:\\";
openFileDialog1.Filter = "wmv files (*.wmv)|*.wmv";
openFileDialog1.FilterIndex = 1;
openFileDialog1.RestoreDirectory = true; //whether or not to remember last directory
DialogResult Result = openFileDialog1.ShowDialog();
///if we get a file, put path and name in textbox
if (Result == DialogResult.OK)
{
txtFileName.Text = openFileDialog1.FileName;
}
// Cancel button was pressed.
else if (Result == DialogResult.Cancel)
{
return;
}
}
private void cbFieldChooser_SelectedIndexChanged(object sender, EventArgs e)
{
//make sure filename has a value
if (txtFileName.Text == "")
{
lblError.Visible = true;
}
else
{
MetaDataReader objMetaData = new MetaDataReader();
txtValue.Text = objMetaData.GetFieldByName(txtFileName.Text, cbFieldChooser.SelectedItem.ToString());
}//end else we have a file to process
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Kris Rudin is a senior developer with Ascentium corporation, with 10 years of experience including both web and Windows client software development.