zoukankan      html  css  js  c++  java
  • ASP.NET获取文件名,后缀名

    using System.IO;  //引入命名空间     

             string path = "text.aspx";
             string pathName = Path.GetFileName(path);       //获取文件全名 text.aspx
             string pathName1 = Paht.GetFileNameWithoutExtension(path);    //获取文件名 text
             string pathName2 = Path.GetExtension(path);    //获取文件后缀名 aspx

        

    FileInfo 类

             FileInfo fi = new FileInfo("C:/abc.txt");
             fi.Extension 值:.txt

  • 相关阅读:
    BiLiBiLi爬虫
    12-UE4-控件类型
    11-UE4-UMG UI设计器
    10-UE4-蓝图定义简介
    UE4-目录结构简介
    UE4-字符串
    UE4-基类
    Redis-事物
    Redis的主从配置
    Redis持久化-AOF
  • 原文地址:https://www.cnblogs.com/spring_wang/p/3064484.html
Copyright © 2011-2022 走看看