﻿using System;
using System.Windows.Forms;

namespace WiFiPasswordRetriever
{
    public partial class MainWindow : Form
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        
        private void btnGetPasswords_Click(object sender, EventArgs e)
        {
            var networkConnections = ConnectionRetriever.Retrieve();
            var sb = new System.Text.StringBuilder();

            foreach (var connection in networkConnections)
            {
                sb.AppendFormat("SSID: {0}", connection.SSID).AppendLine()
                    .AppendFormat("Password: {0}", connection.Password).AppendLine()
                    .AppendLine();
            }

            txtOutput.Text = sb.ToString();
        }
    }
}
