3
Answers

take things from a string?

Photo of eli go

eli go

15y
2.9k
1
hi i have wrote this code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Net;
using System.IO;

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

        //public MatchCollection Matches(string input);

        public static string StringStrip(string Text)
        {
            Text = Regex.Replace(Text, "<.*?>", string.Empty);

            return Text;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //används för att bygga en sträng från ström
            StringBuilder sb = new StringBuilder();

            byte[] buf = new byte[8192];

            HttpWebRequest request = (HttpWebRequest)
                WebRequest.Create("http://rankswebowl.svenskidrott.se/Query.aspx?QueryParm=100|QueryRankPoints DESC,QueryAverage DESC,QueryPlace DESC||1|||||'26768-07'|||||||");
            
            HttpWebResponse response = (HttpWebResponse)
                requset.GetResponse();

            Steam resStream = response.GetResponseStream();

            string tempString = null;
            int count = 0;

            do
            {
                count = resStream.Read(buf, 0, buf.Length);

                if (count != 0)
                {
                    tempString = Encoding.UTF8.GetString(buf, 0, count);
                    sb.Append(tempString);
                }
            }
            while (count > 0);
            {
                string code = StringStrip(sb.ToString());
            }
        }
    }
}

and i wonder how to take out thing from the string, ex names. someone have an idee of how i do ??

Answers (3)

0
Photo of Mykonine
NA 520 0 20y
There are many methods for blending colors. I'd pick what you want to blend first. Note that simulating pigment blending is very different from blending rgb colors.
0
Photo of bilnaad
NA 686 0 20y
You could code something like this and don't use the ColorConverter class. Because that class only converts datatypes. public class ColorUtil { private ColorUtil(){} public static Color MergeColor(Color color0 ,Color color1) { int r ,g ,b; r = color0.R + color1.R; g = color0.G + color1.G; b = color0.B + color1.B; return Color.FromArgb(r ,g ,b); } } The code... ColorUtil.MergeColor(Color.Red ,Color.Blue); Should return a purple color.
0
Photo of varakrishna
NA 5 0 20y
I have coded some thing like this Color clr; clr = Color.Yellow; int rgb = clr.ToArgb(); Color clr1; clr1 = Color.Black; int rgb1 = clr1.ToArgb(); ColorConverter clrconv = new ColorConverter(); int newclr = rgb+rgb1; Color newColor; newColor = (Color)(clrconv.ConvertFromString(newclr.ToString())); so my newColor is holding the new color. But the end result is not so satisfactory. So please help me on this, if you have any other ideas.
0
Photo of varakrishna
NA 5 0 20y
Yeah i am ready to code for converter, can you please give some idea, which would be start up for me?
0
Photo of bilnaad
NA 686 0 20y
I don't think the framework offers a pre made solution for this. So why don't code a converter yourself? It shouldn't be very hard to calculate a new color from two others.