lab5_4 progress

This commit is contained in:
2022-10-27 15:35:02 -05:00
parent 7e8bef6ba5
commit b95e6e4048
140 changed files with 2081 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
namespace Problem1_CalebFontenot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void openButton_Click(object sender, EventArgs e)
{
// Create StreamReader
StreamReader inputFile = null;
// Read the contents of the text file.
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
inputFile = File.OpenText(openFileDialog1.FileName);
}
// Clear the listbox.
listBox1.Items.Clear();
while (!inputFile.EndOfStream)
{
listBox1.Items.Add(inputFile.ReadLine());
}
}
private void saveButton_Click(object sender, EventArgs e)
{
// Create StreamWriter
StreamWriter outputFile = null;
//Open the save file dialog.
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
outputFile == File.OpenWrite(saveFileDialog1.FileName);
}
}
}
}