![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#6
|
|||
|
|||
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"); } } } ![]()
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino. |
|
|
![]() |
||||
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 |
![]() |
|