using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Linq; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //string fn = "IronIntel.Contractor.FICExtDataTable.AssetTripsDataTable,iicontractorbl"; //Type intftype = typeof(IExtDataTable); //Type tp = Type.GetType(fn); //if (!tp.IsAbstract && tp.IsClass &&tp.IsPublic&& tp.GetInterface(intftype.FullName) != null) //{ //} //IExtDataTable ext = Activator.CreateInstance(tp) as IExtDataTable; //Console.WriteLine(ext.ID); //Guid gd = new Guid("10000000-0000-0000-0000-100000000001"); //for (var a = 9; a >= 0; a--) //{ // for (var b = 9; b >= 0; b--) // { // for (var c = 9; c >= 0; c--) // { // if ((2000 + a * 100 + b * 10 + c) % 13 == 0) // { // Console.WriteLine($"number is 2{a}{b}{c}"); // } // } // } //} //const string file = @"C:\Users\cl\Desktop\languages.csv"; //var lines = File.ReadAllLines(file); //var xml = new XDocument(); //var root = new XElement("Category"); //root.Add(new XAttribute("desc", "Communication")); //xml.Add(root); //foreach (var line in lines) //{ // var index = line.IndexOf(','); // var key = line.Substring(0, index); // var value = line.Substring(index + 1).Replace("\\n", "\n"); // var xe = new XElement(key); // xe.Add(new XElement("en", value)); // xe.Add(new XElement("fr", string.Empty)); // xe.Add(new XElement("zh", string.Empty)); // root.Add(xe); //} //Console.WriteLine(xml.ToString()); //var random = new Random(); //var data = new byte[12]; //for (var i = 0; i < 20; i++) //{ // for (var j = 0; j < 12; j++) // { // data[j] = (byte)random.Next('0', '9'); // } // Console.WriteLine(Convert.ToBase64String(data)); //} //var path = @"D:\IronIntel\Mobile\FleetViewMobile\FleetViewClientLib\FleetResources\TextResource.xml"; //var pt = @"C:\Users\cl\Desktop\pt_langs.txt"; //var dict = new Dictionary(); //foreach (var l in File.ReadAllLines(pt)) //{ // var arr = l.Split('\t'); // if (dict.TryGetValue(arr[0], out var val)) // { // Console.WriteLine($"duplicated item: {arr[0]}({val}), new value: {arr[1]}"); // } // else // { // dict.Add(arr[0], arr[1]); // } //} //var ofile = @"C:\Users\cl\Downloads\TextResource.xml"; //var doc = XDocument.Load(path); //var newDoc = new XDocument(); //var newRoot = new XElement("root"); //newDoc.Add(newRoot); //foreach (var node in doc.Root.Elements()) //{ // var key = node.Name.LocalName; // if (dict.TryGetValue(key, out string ptl)) // { // node.Add(new XElement("pt", ptl)); // var ele = newRoot.Element(key); // if (ele == null) // { // newRoot.Add(node); // } // else // { // Console.WriteLine($"duplicate child node: {ele}, new node: {node}"); // } // } // else // { // Console.WriteLine($"cannot find language id: {key}"); // } //} //newDoc.Save(ofile); Console.Write("done."); Console.ReadKey(true); } } }