beta 2中好像io也不能用呀!!!我上次只写using System.IO就提示我错误呀
解决方案 »
- 在oracle中如何使用sql语句块?
- 高分求救:引用Office组件出错
- C#连接数据库的问题
- 终于知道C#的动态类型有什么用了。
- 求教:如何调用基类中接口的实现方法?
- 谁有关于进程的资料?
- 一个想学C#者的问题!
- 我在数据库中进行数据库查询"select * from f where comapny like '%"+this.company+"'可是每次this.company的值都有是'1'这样的话数据库
- 做C#网络开发的时候,哪些适合用webservice来做???
- 谁有最新VS.NET安装包,共享一下。谢谢!
- System.IO 的名字空间是不是不能用 File 类总是无法使用,
- 在一个目录里建立一个文本文件名字为102txt,并把一组字符串写进文本文件.怎么写??thanks
你直接File newfile=new File("C:\\MyIni.ini");不就ok了。
是不是 Bete 2 中的System.IO;不能用
"All methods of the File class are static and can therefore be called without having an instance of a file."既然是静态方法,当然不能生成实例。用下面的code:FileStream s = File.Create("c:\\myini.ini");
.......
StreamWriter s = File.Create("c:\\myini.ini");
s.WriteLine("qqqqq");
s.WriteLine("wwwww");
s.close();
.....
using System.IO;
.......
StreamReader s = File.OpenText("c:\\myini.ini");
while(s.Peek()!=-1)
{
string ReadTxt=s.ReadLine();
Console.WriteLine(ReadTxt);
}
s.close();
.....
using System.IO;
.......
bool aa;
aa=File.Exists("c:\\1.txt");
if (aa)
{
Console.WriteLine("此文件存在");
}
else
{
Console.WriteLine("此文件不存在");
}
.....