Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > .NET
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 29-10-2023
REHome REHome is offline
Miembro
 
Registrado: jul 2003
Ubicación: España
Posts: 454
Poder: 21
REHome Va por buen camino
Me funciona de maravilla.

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

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

        private void button_Enviar_Click(object sender, EventArgs e)
        {
            string expresionRegular = @"#I(.*)O(.*)L(.*)B(.*)V(.*)F(.*)H(.*)R(.*)S(.*)";
            Regex rx = new Regex(expresionRegular,
                   RegexOptions.Compiled | RegexOptions.IgnoreCase);

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

            MatchCollection matches = rx.Matches(texto);
            textBox_I.Text = matches[0].Groups[1].Value;
            textBox_O.Text = matches[0].Groups[2].Value;
            textBox_L.Text = matches[0].Groups[3].Value;
            textBox_B.Text = matches[0].Groups[4].Value;
            textBox_V.Text = matches[0].Groups[5].Value;
            textBox_F.Text = matches[0].Groups[6].Value;
            textBox_H.Text = matches[0].Groups[7].Value;
            textBox_R.Text = matches[0].Groups[8].Value;
            //textBox_S.Text = matches[0].Groups[9].Value;

            MessageBox.Show("Ya se procesó la cadena");
        }
    }
}
Muchas gracias mi muy distinguido amigo.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
decodificar datos recibidos por COM jesmasuso Varios 1 29-11-2014 00:35:03
Almacenar datos recibidos del Tcomport jgarcias2 OOP 0 18-04-2011 00:35:48
Quitar datos recibidos de un puerto serial GrupoDatasoft OOP 3 05-09-2008 16:31:37
Quitar datos recibidos de un puerto serial GrupoDatasoft Varios 3 05-09-2008 16:30:14
Quitar datos recibidos de un puerto serial GrupoDatasoft API de Windows 1 05-09-2008 16:11:51


La franja horaria es GMT +2. Ahora son las 06:21:00.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi