C产品在市场上有哪些独特优势?

2026-05-20 07:161阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计233个文字,预计阅读时间需要1分钟。

C产品在市场上有哪些独特优势?

文件创建:复制代码,代码如下:csharpFile.Create(Application.StartupPath + @\AlarmSet.txt);// 返回带有扩展名的文件名System.IO.Path.GetFileName(filePath);// 返回不带扩展名的文件名System.IO.Path.GetFileNameWithoutExtension(filePath);

C产品在市场上有哪些独特优势?

文件创建:

复制代码 代码如下:File.Create(Application.StartupPath + "\\AlarmSet.txt");//创建该文件
System.IO.Path.GetFileName(filePath) //返回带扩展名的文件名
System.IO.Path.GetFileNameWithoutExtension(filePath) //返回不带扩展名的文件名
System.IO.Path.GetDirectoryName(filePath) //返回文件所在目录

文件存在:

复制代码 代码如下:File.Exists(Application.StartupPath + "\\AlarmSet.txt")
System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(Application.StartupPath + "\\AlarmSet.txt");
MessageBox.Show(info.Exists.ToString());

是不是很简单,但有时候我们可能对GetFileNameWithoutExtension或GetDirectoryName这样的函数,感觉比较陌生,以前还总傻傻的自己写函数实现,原来就一行代码搞定啊~

本文共计233个文字,预计阅读时间需要1分钟。

C产品在市场上有哪些独特优势?

文件创建:复制代码,代码如下:csharpFile.Create(Application.StartupPath + @\AlarmSet.txt);// 返回带有扩展名的文件名System.IO.Path.GetFileName(filePath);// 返回不带扩展名的文件名System.IO.Path.GetFileNameWithoutExtension(filePath);

C产品在市场上有哪些独特优势?

文件创建:

复制代码 代码如下:File.Create(Application.StartupPath + "\\AlarmSet.txt");//创建该文件
System.IO.Path.GetFileName(filePath) //返回带扩展名的文件名
System.IO.Path.GetFileNameWithoutExtension(filePath) //返回不带扩展名的文件名
System.IO.Path.GetDirectoryName(filePath) //返回文件所在目录

文件存在:

复制代码 代码如下:File.Exists(Application.StartupPath + "\\AlarmSet.txt")
System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(Application.StartupPath + "\\AlarmSet.txt");
MessageBox.Show(info.Exists.ToString());

是不是很简单,但有时候我们可能对GetFileNameWithoutExtension或GetDirectoryName这样的函数,感觉比较陌生,以前还总傻傻的自己写函数实现,原来就一行代码搞定啊~