主题:C#的文件管理系统是怎样的...
大家先看下这个从书上抄下来的程序:
using System;
using System.IO;
class DirectoryTest
{
public static void Main(string[] args)
{
Directory d = new Directory("f:\\c#");
Directory d1;
Directory d2;
try
{
d1 = d.CreateSubdirectory("file1");
}
catch (IOException e)
{
Console.WriteLine("directory failed because:{0}", e);
return;
}
try
{
d2 = d.CreateSubdirectory("file1\\file2");
}
catch (IOException e)
{
Console.WriteLine("directory failed because:{0}", e);
return;
}
Console.WriteLine("Create directory successfully!");
}
}
这个程序在编译时部是出现这样的错误:
1.应输入:{ (第四行)
2.类,结构或接口声明中的标记符"{"无效 ;(第五行)
我改了好久都不行,相当的郁闷,在此唯有期望各位不吝赐教了[em0],
[em1][em1][em1][em1][em1][em1][em1]
using System;
using System.IO;
class DirectoryTest
{
public static void Main(string[] args)
{
Directory d = new Directory("f:\\c#");
Directory d1;
Directory d2;
try
{
d1 = d.CreateSubdirectory("file1");
}
catch (IOException e)
{
Console.WriteLine("directory failed because:{0}", e);
return;
}
try
{
d2 = d.CreateSubdirectory("file1\\file2");
}
catch (IOException e)
{
Console.WriteLine("directory failed because:{0}", e);
return;
}
Console.WriteLine("Create directory successfully!");
}
}
这个程序在编译时部是出现这样的错误:
1.应输入:{ (第四行)
2.类,结构或接口声明中的标记符"{"无效 ;(第五行)
我改了好久都不行,相当的郁闷,在此唯有期望各位不吝赐教了[em0],
[em1][em1][em1][em1][em1][em1][em1]