string path = @"D:\abc";
string fileName = "123.txt";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
if (!File.Exists(path + "\\" + fileName))
{
File.Create(path + "\\" + fileName);
}
[转载]c#创建文件夹 - lqsilly - 博客园
相关推荐
- GDI+中发生一般性错误_51CTO博客_gdi+发生一般性错误
- C# 6.0 内插字符串 (Interpolated Strings ) - 刀是什么样的刀 - 博客园
- ASP.NET MVC 中的HttpContextWrapper怎么获取POST请求的所有参数内容
- 抛开官方库,手撸一个轻量级 MCP 服务端 - .NET骚操作 - 博客园
- c# 模拟Http请求 - Ysの陈憨憨 - 博客园
- C#实现AES加密解密 - huanglg - 博客园
- C# LINQ 快速入门实战指南,建议收藏学习! - 追逐时光者 - 博客园
- Semantic Kernel/C#:接入智谱AI的两种方式 - mingupupup - 博客园
Mikel