Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.IO;
- using System.Text.RegularExpressions;
- namespace gigatools {
- public class Parser {
- public static int Main(string[] argv) {
- StringBuilder output = new StringBuilder();
- string file = argv[0];
- using (StreamReader reader = new StreamReader(file)) {
- while (reader.Peek() >= 0) {
- string line = reader.ReadLine();
- int loginIndex = 0;
- int startIndex = 0;
- if ((loginIndex = line.IndexOf("Login:")) == -1) {
- continue;
- }
- startIndex = line.IndexOf(": ") + 2;
- string data = line.Substring(startIndex);
- string[] delimiters = data.Split(':');
- string username = delimiters[0];
- string password = delimiters[1];
- output.AppendFormat("Username: {0}\r\nPassword: {1}\r\n\r\n", username, password);
- }
- }
- File.WriteAllText("output.txt", output.ToString());
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement