Autor Beitrag
thefiloe
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Sa 17.04.10 23:46 
also ich habe ein Programm das greift auf eine cfg datei zu und ändert diese je nach combobox (bzw 2 comboboxen) der inhalt dieser comboboxen wird in einem textfeld zusammengefügt und dann in die datei geschrieben. jetzt ist es aber so, dass ich bei 2-3 items in der combobox eine bestimmte zeile ersetzen will. jetzt kommt das problem

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
 private void bestätigen_Click(object sender, EventArgs e)
        {
            TextDatei c_textdatei = new TextDatei();
            string fs = c_textdatei.ReadFile(@"C:\Users\florian\AppData\Roaming\Teeworlds\hallo.txt");
            if (checkBox1.Checked)
            {
                c_textdatei.Append(@textBox2.Text + ("/Teeworlds/hallo.cfg"), textBox1.Text + Environment.NewLine);
             
            }
            else
            {
                c_textdatei.WriteLine(textBox2.Text + ("/Teeworlds/hallo.cfg"), 4, textBox1.Text, true);
            }
        }


denn ich möchte aus der ifbedingung mehrere in der art machen : if (combobox1.selectedItem = "mouse1") { }

Moderiert von user profile iconChristian S.: C#-Tags hinzugefügt
JüTho
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2021
Erhaltene Danke: 6

Win XP Prof
C# 2.0 (#D für NET 2.0, dazu Firebird); früher Delphi 5 und Delphi 2005 Pro
BeitragVerfasst: So 18.04.10 13:18 
Hallo und :welcome:

Tut mir leid, ich verstehe nur Bahnhof. Vielleicht hilft es etwas, wenn du deinen langen Satz mit Punkt und Komma (und ausreichend Großbuchstaben) gliederst und an einem Beispiel zeigst, was du willst, was nicht und was dabei herauskommt.

Falls dein Problem nur die if-Bedingung ist, geht das einfach mit if-else if-else if-else.

Gruß Jürgen
danielf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1012
Erhaltene Danke: 24

Windows XP
C#, Visual Studio
BeitragVerfasst: So 18.04.10 14:28 
Hallo und auch von mir ein herzliches :welcome:,

ich sehe nicht nur den Bahnhof, sondern auch die Züge :D

Aber ich vermute auch, dass es ein reines if-else Problem ist.

Da hilft nur das hier :D

Gruß