public static void Main() { var parser = new ImageParser(); string imageInfoJson; using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); using (var file = new FileStream("image1.bmp", FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); using (var file = new FileStream("image2.gif", FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); }
public static void Main(string[] args) { var parser = new ImageParser(); string imageInfoJson; //using (var file = new FileStream("C:\\Users\\Вера\\Downloads\\ImageParser.csproj\\2GU.gif", FileMode.Open, FileAccess.Read)) using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); }
public static void Main(string[] args) { var parser = new ImageParser(); string imageInfoJson; List <string> files = new List <string> { "image.png", "BMP.bmp" }; foreach (var filename in files) { using (var file = new FileStream(filename, FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); } }
public static void Main(string[] args) { var parser = new ImageParser(); string imageInfoJson; using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read)) { imageInfoJson = parser.GetImageInfo(file); } Console.WriteLine(imageInfoJson); /* * string[] lines = imageInfoJson.Split(new char[] { '\n' }, * StringSplitOptions.RemoveEmptyEntries); * foreach (var e in lines) * Console.WriteLine(e.Length); * Console.WriteLine(lines[0].Substring(1));*/ Console.ReadLine(); }
public void SetUp() { parser = new ImageParser(); }