All pastes #367925 Raw Edit

Anonymous

public text v1 · immutable
#367925 ·published 2007-02-22 18:16 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Log_parser
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String Ln = textBox1.Text;
            String Timestamp = "No Timestamp";
            String Nick = "No Nick";
            int tallet;
            //Timestamp check
            if (Ln[0] == '[')
            {
                if (Int32.TryParse(Ln[1].ToString(), out tallet))
                {
                    Timestamp = Ln.Substring(1, Ln.IndexOf(']') - 1);
                    Ln = Ln.Substring(Timestamp.Length + 2);
                    Ln.Trim();
                    textBox1.Text = "'" + Ln;
                }
            }
            //Timestamp check slut
            //Finder nick
            if (Ln[0] == '<')
            {
                Nick = Ln.Substring(1, Ln.IndexOf('>'));
                //MessageBox.Show(Nick);
            }

            
        }
    }
}