private void frmExecute_Load(object sender, EventArgs e)
{
string[] data = File.ReadAllLines("c:\\toyotoconsole\\tssetup.txt");
// Loop through each line, split, add if server
for (int i = 0; i < data.Length; i++)
{
var serverValues = data[i].Split('|');
}
}
Okay first C# windows project, which is cool since I have never really touched this beyond the odd debugging foray.
My problem is the array serverValues is built in a function, how do I make this array available for all functions (not sure if using the right term here) in the same form script (probably the wrong word there as well). Is there a public declaration?
serverValuesinto a field: declare it outside:private string[] serverValues = null; ... private void frmExecute_Load(object sender, EventArgs e) {...serverValues = data[i].Split('|');...}serverValueswill contain only value ofdata[data.length - 1].Split('|')