Hello
I am currently trying to read specific data from a .hrm file and then display it within a form in c#. For example I want to read the date data from this file and then display it on the form. All I have managed to do is read in the whole file into a textbox. I've been struggling with this for a while now and would appreciate any help I can get.
This is the code I have so far that reads the whole file into the richtextbox.
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.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string Chosen_File = "";
openFile.Title = "Choose File";
openFile.FileName = "";
openFile.Filter = "HRM|*.hrm|Text Document|*.txt";
openFile.ShowDialog();
if (openFile.ShowDialog() != DialogResult.Cancel)
{
Chosen_File = openFile.FileName;
richTextBox1.LoadFile(Chosen_File, RichTextBoxStreamType.PlainText);
}
}
}
}
This is the file I want to retrieve the data from.
[Params]
Version=106
Monitor=34
SMode=111111100
Date=20100926
StartTime=09:20:11.0
Length=01:06:11.6
Interval=1
Upper1=0
Lower1=0
Upper2=0
Lower2=0
Upper3=180
Lower3=177
Timer1=00:00:00.0
Timer2=00:00:00.0
Timer3=00:00:00.0
ActiveLimit=0
MaxHR=195
RestHR=48
StartDelay=0
VO2max=54
Weight=70
I am trying to get the Date data after the = sign.
Any help would be appreciated, thank you.