首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

未处理的System.NotSupportedException类型的异常出现在 mscorlib.dll 中

2014-01-28 
using System using System.IO using System.Text namespace ConsoleApplication { /// summary /// C

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");

        

热点排行