Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: hspguisourcev301/HspGuiSourceV301/GuiDLLs/FileLog/FileLogExample/Form1.cs
- Revision:
- 3:36de8b9e4b1a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hspguisourcev301/HspGuiSourceV301/GuiDLLs/FileLog/FileLogExample/Form1.cs Sat Apr 10 03:05:42 2021 +0000
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Maxim.Utility;
+
+namespace FileLogExample
+{
+ public partial class Form1 : Form
+ {
+ FileLog fileLog = new FileLog();
+ bool fileSelected = false;
+ int count = 0;
+
+ public Form1()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ fileSelected = fileLog.SelectCSVFile("fileLogExample");
+ if (fileSelected)
+ MessageBox.Show("File Select successful");
+ else
+ MessageBox.Show("File Select failed");
+ }
+ catch(System.IO.IOException ex)
+ {
+ MessageBox.Show(ex.Message, "File Select Failed");
+ }
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (fileSelected == true)
+ {
+ fileLog.WriteLine("Writing Line " + count++);
+ }
+ }
+ }
+}