Example #1
0
        void Fix(string uri, int count, int row)
        {
            TextResponse.Clear();

            try
            {
                string response = NetHelp.WebClientGet(uri);

                string reg = @"[<].*?[>]";

                response = Regex.Replace(response, reg, "");

                TextResponse.Text = Regex.Replace(response, @"(?s)\n\s*\n", "\n");
            }
            catch (Exception e)
            {
                TextResponse.Text = e.ToString(); return;
            }

            List <string> lines = new List <string>();

            StringBuilder text = new StringBuilder();

            lines = TextResponse.Lines.ToList();

            lines.RemoveRange(0, count);

            int i = 0;

            foreach (var item in lines)
            {
                i += 1;

                text.AppendLine(item);

                if (i % row == 0)
                {
                    text.AppendLine();
                }
            }

            TextResponse.Text = text.ToString();
        }
Example #2
0
        void FixEx(string uri, int count, int row)
        {
            TextResponse.Clear();

            try
            {
                string response = NetHelp.WebClientGet(uri);

                TextResponse.Text = MyRegex.Span(response);
            }
            catch (Exception e)
            {
                TextResponse.Text = e.ToString(); return;
            }

            List <string> lines = new List <string>();

            StringBuilder text = new StringBuilder();

            lines = TextResponse.Lines.ToList();

            lines.RemoveRange(0, count);

            int i = 0;

            foreach (var item in lines)
            {
                i += 1;

                text.AppendLine(item);

                if (i % row == 0)
                {
                    text.AppendLine();
                }
            }

            TextResponse.Text = text.ToString();
        }