Simple example with a console program. Now it's up to you to customize it within WinForms.
Code:
using System.IO;
using System.Text;
namespace Password
{
public class Account
{
public string Password { get; set; }
public string Url { get; set; }
public string Username { get; set; }
}
internal static class Program
{
private static void SaveAccount(Account account)
{
using (var writer = new StreamWriter(@"D:\Temp\Accounts.txt", true, new UTF8Encoding()))
{
writer.WriteLine(account.Url);
writer.WriteLine(account.Username);
writer.WriteLine(account.Password);
for (int i = 0; i < account.Url.Length; i++)
writer.Write("-");
writer.WriteLine();
}
}
private static void Main()
{
var account = new Account
{
Url = "http://www.myurl.com/test/",
Username = "JohnDoe",
Password = "1234567"
};
SaveAccount(account);
}
}
}