Ver Mensaje Individual
  #5  
Antiguo 29-10-2023
tsk tsk is online now
Miembro
 
Registrado: dic 2017
Posts: 52
Reputación: 7
tsk Va por buen camino
En que sentido se complica

Código PHP:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Text.RegularExpressions;

public class 
Ventana Form
{
    private 
Button b;
    private 
TextBox txtBox_I;
    private 
TextBox txtBox_O;
    private 
TextBox txtBox_L;
    private 
TextBox txtBox_B;
    private 
TextBox txtBox_V;
    private 
TextBox txtBox_F;
    private 
TextBox txtBox_H;
    private 
TextBox txtBox_R;
    private 
TextBox txtBox_S;
    
    static public 
void Main()
    {
        
Application.Run(new Ventana());
    }

    private 
Ventana()
    {
        
= new Button();
        
b.Text "Click Me!";
        
b.Click += new EventHandler (Button_Click);
        
Controls.Add(b);

        
txtBox_I = new TextBox();
        
txtBox_I.Text "";
        
txtBox_I.Location = new Point(10,20);
        
Controls.Add(txtBox_I);

        
txtBox_O = new TextBox();
        
txtBox_O.Text "";
        
txtBox_O.Location = new Point(10,40);
        
Controls.Add(txtBox_O);
        
        
txtBox_L = new TextBox();
        
txtBox_L.Text "";
        
txtBox_L.Location = new Point(10,60);
        
Controls.Add(txtBox_L);

        
txtBox_B = new TextBox();
        
txtBox_B.Text "";
        
txtBox_B.Location = new Point(10,80);
        
Controls.Add(txtBox_B);

        
txtBox_V = new TextBox();
        
txtBox_V.Text "";
        
txtBox_V.Location = new Point(10,100);
        
Controls.Add(txtBox_V);

        
txtBox_F = new TextBox();
        
txtBox_F.Text "";
        
txtBox_F.Location = new Point(10,120);
        
Controls.Add(txtBox_F);

        
txtBox_H = new TextBox();
        
txtBox_H.Text "";
        
txtBox_H.Location = new Point(10,140);
        
Controls.Add(txtBox_H);

        
txtBox_R = new TextBox();
        
txtBox_R.Text "";
        
txtBox_R.Location = new Point(10,160);
        
Controls.Add(txtBox_R);

        
txtBox_S = new TextBox();
        
txtBox_S.Text "";
        
txtBox_S.Location = new Point(10,180);
        
Controls.Add(txtBox_S);
    }

    private 
void Button_Click(object senderEventArgs e)
    {
        
string pattern1 = @"#I(.*)O(.*)L(.*)B(.*)V(.*)F(.*)H(.*)R(.*)S(.*)";
         
Regex rx = new Regex(pattern1,
                
RegexOptions.Compiled RegexOptions.IgnoreCase);

        
string text "#I225.7O226.2L006B100V25.7F50.2H50.2R0080S€„€ˆ„À";

        
MatchCollection matches rx.Matches(text);
        
txtBox_I.Text matches[0].Groups[1].Value;
        
txtBox_O.Text matches[0].Groups[2].Value;
        
txtBox_L.Text matches[0].Groups[3].Value;
        
txtBox_B.Text matches[0].Groups[4].Value;
        
txtBox_V.Text matches[0].Groups[5].Value;
        
txtBox_F.Text matches[0].Groups[6].Value;
        
txtBox_H.Text matches[0].Groups[7].Value;
        
txtBox_R.Text matches[0].Groups[8].Value;
        
txtBox_S.Text matches[0].Groups[9].Value;
        
        
MessageBox.Show("Ya se procesó la cadena");
    }

Responder Con Cita