Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string find = "itemdata_";
- List<string> found = list1.FindAll(s => s.Contains(find)); // find by name
- Console.WriteLine();
- Directory.CreateDirectory("itemdatas");
- string splitBy = "? ?? ??";
- string[] results = null;
- foreach (var x in found)
- {
- Console.WriteLine(x);
- File.Create(x);
- StreamWriter sw = new StreamWriter(String.Format(@"{0}\itemdatas\{1}", Directory.GetCurrentDirectory(), x));
- string result = Encoding.Default.GetString(pk2read.getFile(x));
- //results = result.Split(new char[] { '\n', '\r' });
- //List<string> lista = new List<string>();
- //for (int i = 0; i < 1; i++)
- //{
- // lista.Add(results[i].Remove(results[i].IndexOf('?')));
- //}
- //results = result.Split(splitBy);
- //Console.WriteLine(results.Length);
- //for (int i = 0; i < lista.Count; i++)
- //{
- // sw.WriteLine(lista[i]);
- //}
- result = result.Replace("\0", string.Empty); // A fájlban rengeteg a "\0", ezt sikeresen eltávolítja
- sw.WriteLine(result);
- sw.Close();
- StreamReader sr = new StreamReader(String.Format(@"{0}\itemdatas\{1}", Directory.GetCurrentDirectory(), x));
- for (int i = 0; i < result.Length; i++)
- {
- string s = sr.ReadLine();
- s = s.Substring(s.IndexOf('?')); // ez itt argument out of range exceptiont dob
- Console.WriteLine(s);
- }
- //int length = File.ReadAllLines(result).Length;
- //File.ReadAllLines(x);
- //foreach (var s in results)
- //{
- // Console.WriteLine(s);
- //}
- }
- Console.WriteLine();
- //string f1 = Encoding.Default.GetString(pk2read.getFile(find));
- //Console.WriteLine(f1);
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment