title: C# - How to call a method from static void main
body: <p>I have some code in static void main, although I would like it to call the startremdup method (as it calls the RemoveDuplicate, with the appropriate parameters) from static void main, I have tried startremdup();</p>
  
  <pre><code>private void RemoveDuplicate(string sourceFilePath, string destinationFilePath)
  {
      var readLines = File.ReadAllLines(sourceFilePath, Encoding.Default);
  
      File.WriteAllLines(destinationFilePath, readLines.Distinct().ToArray(), Encoding.Default);
  }
  
  
  private void startremdup(object sender, EventArgs e)
  {
      RemoveDuplicate("C:\test.txt", "C:\test2.txt");
  }
  </code></pre>