zoukankan      html  css  js  c++  java
  • 磁盘文件IO操作

    string filePath = @"E:Randy0528中文目录JustTest.rar";
    Response.Write("文件路径:"+filePath);
    Response.Write("
    更改路径字符串的扩展名。
    ");
    Response.Write(System.IO.Path.ChangeExtension(filePath, "txt"));
    Response.Write("
    返回指定路径字符串的目录信息。。
    ");
    Response.Write(System.IO.Path.GetDirectoryName(filePath));
    Response.Write("
    返回指定的路径字符串的扩展名。
    ");
    Response.Write(System.IO.Path.GetExtension(filePath));
    Response.Write("
    返回指定路径字符串的文件名和扩展名。
    ");
    Response.Write(System.IO.Path.GetFileName(filePath));
    Response.Write("
    返回不具有扩展名的指定路径字符串的文件名。
    ");
    Response.Write(System.IO.Path.GetFileNameWithoutExtension(filePath));
    Response.Write("
    获取指定路径的根目录信息。
    ");
    Response.Write(System.IO.Path.GetPathRoot(filePath));
    Response.Write("
    返回随机文件夹名或文件名。
    ");
    Response.Write(System.IO.Path.GetRandomFileName());
    Response.Write("
    创建磁盘上唯一命名的零字节的临时文件并返回该文件的完整路径。
    ");
    Response.Write(System.IO.Path.GetTempFileName());
    Response.Write("
    返回当前系统的临时文件夹的路径。
    ");
    Response.Write(System.IO.Path.GetTempPath());
    Response.Write("
    确定路径是否包括文件扩展名。
    ");
    Response.Write(System.IO.Path.HasExtension(filePath));
    Response.Write("
    获取一个值,该值指示指定的路径字符串是包含绝对路径信息还是包含相对路径信息。
    ");
    Response.Write(System.IO.Path.IsPathRooted(filePath));
  • 相关阅读:
    [bzoj]2131: 免费的馅饼
    [bzoj]1098: [POI2007]办公楼biu
    [luogu]P2051 [AHOI2009]中国象棋
    [luogu]P2825 [HEOI2016/TJOI2016]游戏
    MSSQL To MongoDB Tool (FREE)
    虚拟机和Linux安装详解
    Maven
    springmvc的文件上传和下载,框架集成
    json详解以及fastjson使用
    JSP——语法,指令,表达式语言(EL),JSTL标签
  • 原文地址:https://www.cnblogs.com/liandy0906/p/7149030.html
Copyright © 2011-2022 走看看