using System; using System.Text; using System.IO; using System.Resources; using System.Reflection; using System.Collections; using System.Globalization; using com.drew.metadata; using com.drew.imaging.jpg; //using System.Threading; /// /// The C# class was made by Ferret Renaud: /// renaud91@free.fr /// If you find a bug in the C# code, feel free to mail me. /// namespace com { public sealed class Run { private static readonly string NO_UNKNOWN = "noUnknown"; private static readonly string UNKNOWN = "Unknown"; public static readonly CultureInfo newCulture = new System.Globalization.CultureInfo("es-AR"); private static bool noUnknown = false; private static void FindNoUnknown(string[] args) { for (int i=0; i "+fileName+" <---Campeón\n"); IEnumerator directoryIterator = metadata.GetDirectoryIterator(); while (directoryIterator.MoveNext()) { com.drew.metadata.Directory directory = (com.drew.metadata.Directory) directoryIterator.Current; // Console.WriteLine("Dr "+directory.ToString()); IEnumerator ie = directory.GetErrors(); while (ie.MoveNext()) { Console.Error.WriteLine("Error Found: "+ie.Current); } IEnumerator tagsIterator = directory.GetTagIterator(); while (tagsIterator.MoveNext()) { Tag aTag = (Tag) tagsIterator.Current; string aDescription = UNKNOWN; try { aDescription = aTag.GetDescription(); } catch (MetadataException e1) { Console.Error.WriteLine(e1.Message); } string aName = aTag.GetTagName(); if (noUnknown && (aName.IndexOf(UNKNOWN) >= 0 || aDescription.IndexOf(UNKNOWN) >= 0)) { continue; } else { sb.Append(aTag.GetTagName()); sb.Append('='); try { sb.Append(aTag.GetDescription()); } catch (MetadataException e2) { Console.Error.WriteLine(e2.Message); } //sb.Append("\n"); sb.Append("|"); } aTag = null; aDescription = null; aName = null; } directory = null; tagsIterator = null; } directoryIterator = null; metadata = null; // Console.Out.WriteLine(sb.ToString()); string SoltecMetadataPath = System.Configuration.ConfigurationSettings.AppSettings.Get("SoltecMetadataPath"); FileStream fsOut = new FileStream(SoltecMetadataPath , FileMode.Append, FileAccess.Write, FileShare.ReadWrite); // Create a reader that can read characters from the FileStream. StreamWriter sw = new StreamWriter(fsOut); sw.WriteLine (sb.ToString()); sw.Flush(); sw.Close(); } } // Console.ReadLine(); } } }