using System;
using System.IO;
using System.Text;
namespace ConsoleApplication
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
FileInfo fi = new FileInfo("@D:\aaa.txt");
if( !fi.Exists )
{
fi.Create();
}
FileStream fs = new FileStre(@"D:\aaa.txt",FileMode.Open,FileAccess.ReadWrite );
fs.Flush();
fs.Close();
}
catch(System.IO.FileNotFoundException ex)
{
Console.WriteLine(ex);
Console.ReadLine();
}
}
}
}
未处理的System.NotSupportedException类型的异常出现在 mscorlib.dll 中。
其他信息: 不支持给定路径的格式。
------解决方法--------------------------------------------------------
FileInfo fi = new FileInfo(@"D:\aaa.txt");