I have a text file with many duplicates and want to delete the duplicates and then output the updated version of the file in the same order, example:

**Original**

```
    10
    a
    f
    a
    b
    g
    a
    f
    b
    h
    r

```

**Updated Version**

```
    a
    f
    b
    g
    h
    r

```

I want to achieve this using an array of some sort and this is what I have so far,

```
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace Duplicates
{
public partial class Form1 : Form
{
    //Global Variables
    int[] Original;

    public Form1()
    {
        InitializeComponent();
    }

    //Exit Application
    private void mnuExit_Click_1(object sender, EventArgs e)
    {
        this.Close();
    }

    //Load File
    private void mnuLoad_Click_1(object sender, EventArgs e)
    {
        //code to load the numbers from a file
        OpenFileDialog fd = new OpenFileDialog();

        //open the file dialog and check if a file was selected
        if (fd.ShowDialog() == DialogResult.OK)
        {
        //open file to read
        StreamReader sr = new StreamReader(fd.OpenFile());
        int Records = int.Parse(sr.ReadLine());

        //Assign Array Sizes
        Original = new int[Records];

        //Go through text file              
        for (int i = 0; i < Records; i++)
        {
            Original[i] = int.Parse(sr.ReadLine());    
        }     
       }

    }
    private void btnOutput_Click(object sender, EventArgs e)
    {
        //store Original array
        string Output = "Original \n";

        for (int i = 0; i < Original.Length; i++)
        {
            Output = Output + Original[i] + "\n";
        }

        int[] TempArray = new int[Original.Length];

        for (int i = 0; i < Original.Length; i++)
        {
            TempArray[i] = Original[i];
        }

    //add code here

        //output the original array and new array
        Output = Output + "Original with Delete\n";
        for (int i = 0; i < Original.Length; i++)
        {
            Output = Output + Original[i] + "\n";
        }
        lblOutput.Text = Output;
    }

}
    }

```

**Also I am using Windows Forms Application**