private void button1_Click(object sender, EventArgs e)
{
string fileLoc = @"c:\wms.txt";
if (File.Exists(fileLoc))
{
using (TextReader tr = new StreamReader(fileLoc))
{
MessageBox.Show(tr.ReadLine());
}
}
}
This works perfectly in when I create a Windows Application.
When I use the same code in a Device application - Windows CE i get error:
Using: .Net 2.0 , visual Studio 2005
Your device does not have a c
drive. Replace
string fileLoc = @"c:\wms.txt";
with
string fileLoc = @"wms.txt";
It seems that the root folder is automatically added to your path with a \