Hallo,
ich bin bei folgendem Codestück am Verzweifeln-
es ist nicht kompilierbar und bringt immer Fehler CS 0177 für die beiden
Output-Variablen, ohne dass ich den Grund dafür erkennen kann.
Kann mir jemand von Euch alten Hasen sagen, wo das Problem liegt?
Vielen Dank schon im Vorraus!
using System.Text.RegularExpressions;//Regex
using System.IO;//Streamreader
using System.Windows.Forms;//Messagebox
using System.Collections.Generic;//stellt List-Objekt bereit
public void AnfEndwertausgeben(int spaltenindex, string pfad, string trennzeichen, out string anfwert, out string endwert)
{
try
{
// Sets the file the StreamReader will read from StreamReader
sr = new System.IO.StreamReader(pfad);
string zeile;
List<string> spalte = new List<string>();
// Read lines and fill array list. While loop will go through the whole file.
while ((zeile = sr.ReadLine()) != null)
{
// Splits the line at every comma. Places each split into the string array
string[] lines = Regex.Split(zeile, trennzeichen);
spalte.Add(lines[spaltenindex]);
}
anfwert=spalte[0];
int i=spalte.Count;
endwert=spalte[i-1];
}
catch (System.Exception excep)
{
MessageBox.Show(excep.Message);
}
}
ich bin bei folgendem Codestück am Verzweifeln-
es ist nicht kompilierbar und bringt immer Fehler CS 0177 für die beiden
Output-Variablen, ohne dass ich den Grund dafür erkennen kann.
Kann mir jemand von Euch alten Hasen sagen, wo das Problem liegt?
Vielen Dank schon im Vorraus!
using System.Text.RegularExpressions;//Regex
using System.IO;//Streamreader
using System.Windows.Forms;//Messagebox
using System.Collections.Generic;//stellt List-Objekt bereit
public void AnfEndwertausgeben(int spaltenindex, string pfad, string trennzeichen, out string anfwert, out string endwert)
{
try
{
// Sets the file the StreamReader will read from StreamReader
sr = new System.IO.StreamReader(pfad);
string zeile;
List<string> spalte = new List<string>();
// Read lines and fill array list. While loop will go through the whole file.
while ((zeile = sr.ReadLine()) != null)
{
// Splits the line at every comma. Places each split into the string array
string[] lines = Regex.Split(zeile, trennzeichen);
spalte.Add(lines[spaltenindex]);
}
anfwert=spalte[0];
int i=spalte.Count;
endwert=spalte[i-1];
}
catch (System.Exception excep)
{
MessageBox.Show(excep.Message);
}
}