StreamReader rs;
String path = " ";
String questionFile="sum_difference.txt";
try
{
path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
// Append file path to name and then open the stream
rs = new StreamReader(path + "\\" + questionFile,Encoding.Default);
//rs = new StreamReader(fs);
}
catch (Exception)
{
MessageBox.Show("Error: cannot locate file " +path+"\\"+questionFile);
return false;
}
各位高手给我看一下我的代码有问题吗,为什么我在运行时一直出现FileNotFound异常,补充:程序的目标平台是windowsmobile6.0
String path = " ";
String questionFile="sum_difference.txt";
try
{
path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
// Append file path to name and then open the stream
rs = new StreamReader(path + "\\" + questionFile,Encoding.Default);
//rs = new StreamReader(fs);
}
catch (Exception)
{
MessageBox.Show("Error: cannot locate file " +path+"\\"+questionFile);
return false;
}
各位高手给我看一下我的代码有问题吗,为什么我在运行时一直出现FileNotFound异常,补充:程序的目标平台是windowsmobile6.0
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货