ich soll zwei Dateien vergleichen C#?

Programmiere noch nicht so lange, brauche deshalb eure Hilfe Ich soll zwei Dateien A & B mit einander vergleichen. der Unterschied soll in eine dritte Datei geschrieben werden. Alles was in Datei A geändert wurde soll in die dritte datei mit rot markiert werden. Alles was neu hinzugefügt ist soll mit blau markiert werden. könnt ihr mir bitte helfen??

public void Dateivergleich(string A, string B)
    {
      string path = @"C:\Users\Z0009918\Desktop\Test1";
      string[] linesA = File.ReadAllLines(A);
      string[] linesB = File.ReadAllLines(B);
      //IList<string> onlyB = linesB.Except(linesA).ToList();
      //for (var i = 0; i < onlyB.Count; ++i)
      // {
      //  if (onlyB[i].StartsWith("%"))
       
      //{
       //    onlyB[i] = "";
       // }
        IEnumerable<string> onlyB = linesB.Except(linesA);
        //}
        File.WriteAllLines(Path.Combine(path, "result.txt"), onlyB);
        
      // }
      /*for (int i = 0; i < linesA.Length; i++)
      {
        string row = linesA[i];
        if (row.StartsWith("%"))
        {
          IEnumerable<string> onlyA = linesB.Except(linesA);
          File.WriteAllLines(Path.Combine(path, "result.txt"), onlyB);
        }
        else
        {
          MessageBox.Show("Fehler");
        }*/
      }
    }
programmieren, C Sharp
Wieso funktionier bei mir [System.Windows.MessageBox]::Show($DropDown)::OK in PowerShell nicht??

Hallo,
wo liegt die Fehler wieso funktioniert der [System.Windows.MessageBox]::Show($DropDown)::OK Befehl in meiner Code nicht??

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

  [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

  

  $Form = [System.Windows.Forms.MessageBox]::OK

   

  $Form.width = 300

  $Form.height = 150

  $Form.Text = ”DropDown”

  

  $DropDown = [System.Windows.MessageBox]::Show($DropDown)::OK

  $DropDown.Location = new-object System.Drawing.Size(100,10)

  $DropDown.Size = new-object System.Drawing.Size(130,30)

  ForEach ($Item in $DropDownArray) {

   [void] $DropDown.Items.Add($Item)

  }

  $Form.Controls.Add($DropDown)

  $DropDownLabel = [System.Windows.MessageBox]::Show($DropDown)::OK

  $DropDownLabel.Location = new-object System.Drawing.Size(10,10) 

  $DropDownLabel.size = new-object System.Drawing.Size(100,40) 

  $DropDownLabel.Text = "Suchen Sie die Pfad aus"

  $Form.Controls.Add($DropDownLabel)

    $Form.Controls.Add($DropDown)

  $DropDownLabel = [System.Windows.MessageBox]::Show($Form)::OK

  $DropDownLabel.Location = new-object System.Drawing.Size(10,10) 

  $DropDownLabel.size = new-object System.Drawing.Size(100,40) 

  $DropDownLabel.Text = "Zeit"

  $Form.Controls.Add($DropDownLabel)

  $Button = [System.Windows.MessageBox]::Show($Button)::OK

  $Button.Location = new-object System.Drawing.Size(100,50)

  $Button.Size = new-object System.Drawing.Size(100,20)

  $Button.Text = "Weiter"

  $Button.Add_Click({Return-DropDown})

  $form.Controls.Add($Button)

$result=[System.Windows.MessageBox]::Show($Form,$Button,$DropDownLabel,$DropDown,[System.Windows.MessageBoxResult]::OK)

   

  return $script:choice

Code, PowerShell
Weitere Inhalte können nur Nutzer sehen, die bei uns eingeloggt sind.