Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Assignment_1
- {
- public partial class Form5 : Form
- {
- public Form5()
- {
- InitializeComponent();
- button2.UseMnemonic = false;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- DialogResult results;
- results = saveFileDialog1.ShowDialog();
- StreamWriter str1 = new StreamWriter(saveFileDialog1.FileName +".txt");
- str1.WriteLine("Patient name: " + textBox1.Text);
- str1.WriteLine("Blood pressure: " + textBox2.Text);
- str1.WriteLine("Height: " + textBox3.Text);
- str1.WriteLine("Weight: " + textBox4.Text);
- str1.WriteLine("BMI: " + textBox5.Text);
- str1.Close();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- DialogResult results;
- results = openFileDialog1.ShowDialog();
- StreamReader rd1 = new StreamReader(openFileDialog1.FileName);
- textBox1.AppendText(rd1.ReadLine());
- textBox2.AppendText(rd1.ReadLine());
- textBox3.AppendText(rd1.ReadLine());
- textBox4.AppendText(rd1.ReadLine());
- textBox5.AppendText(rd1.ReadLine());
- rd1.Close();
- }
- private void Form5_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement