各类语言对文件的操作

来源:互联网 发布:淘宝电费 编辑:程序博客网 时间:2024/04/30 09:17

1、c#

写文件:

读文件:

删除文件:

 public static string  DeleteFile(string path)
        {
            if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
            {
                System.IO.File.Delete(System.Web.HttpContext.Current.Server.MapPath(path));
                return "yes";
            }
            return "no";
        }

2、php

写文件:

读文件:

删除文件:

3、asp

写文件:

读文件:

删除文件:

4、java

写文件:

读文件:

删除文件:

原创粉丝点击