frontlinegamerz
New member
- Joined
- Jan 6, 2025
- Messages
- 1
- Programming Experience
- 1-3
I'm not an expert with c# but i am on my own learning. Can anyone look at the following code and tell me how it looks?
File:
// START ----- CHECK FOR FILES AND LOAD
try
{
if (File.Exists("data.dat"))
using (StreamReader sr = new StreamReader("data.dat"))
{
string line;
while ((line = sr.ReadLine()) != null)
{
// insert data into system
}
}
else
{
Mbox msgbox = new Mbox();
msgbox.Text = "First Time Setup";
msgbox.Show();
// create file
using (FileStream fs = File.Create("data.dat"))
{
msgbox.Close();
}
}
}
catch (Exception)
{
throw;
}