EDN Admin
Well-known member
hi all
i am having an error showing illegal characters in path . here is my sample code
public List<string[]> parseCSV(string path)<br/>
{<br/>
List<string[]> parsedData = new List<string[]>(); <br/>
try<br/>
{<br/>
using (StreamReader readFile = new StreamReader(path))<br/>
{<br/>
string line;<br/>
string[] row;<br/>
while ((line = readFile.ReadLine()) != null)<br/>
{<br/>
row = line.Split(,);<br/>
parsedData.Add(row);<br/>
}<br/>
}<br/>
}<br/>
catch (Exception e)<br/>
{<br/>
MessageBox.Show(e.Message);<br/>
}<br/>
<br/>
return parsedData;<br/>
<br/>
}<br/>
<br/>
<br/>
public string path()<br/>
{<br/>
string pth = "F:test1.csv";<br/>
return pth;<br/>
}<br/>
<br/>
private void button1_Click(object sender, EventArgs e)<br/>
{<br/>
parseCSV(path());<br/>
} <hr class="sig MSDN Forum
View the full article
i am having an error showing illegal characters in path . here is my sample code
public List<string[]> parseCSV(string path)<br/>
{<br/>
List<string[]> parsedData = new List<string[]>(); <br/>
try<br/>
{<br/>
using (StreamReader readFile = new StreamReader(path))<br/>
{<br/>
string line;<br/>
string[] row;<br/>
while ((line = readFile.ReadLine()) != null)<br/>
{<br/>
row = line.Split(,);<br/>
parsedData.Add(row);<br/>
}<br/>
}<br/>
}<br/>
catch (Exception e)<br/>
{<br/>
MessageBox.Show(e.Message);<br/>
}<br/>
<br/>
return parsedData;<br/>
<br/>
}<br/>
<br/>
<br/>
public string path()<br/>
{<br/>
string pth = "F:test1.csv";<br/>
return pth;<br/>
}<br/>
<br/>
private void button1_Click(object sender, EventArgs e)<br/>
{<br/>
parseCSV(path());<br/>
} <hr class="sig MSDN Forum
View the full article