002集—创建文件夹—VB.NET

VB.NET创建文件夹方法如下:

复制代码
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Try
        If Directory.Exists(TextBox1.Text) Then
            MsgBox("此目录存在")
            Return
        End If
        Dim di As DirectoryInfo = Directory.CreateDirectory(TextBox1.Text)
        MsgBox("创建成功")
    Catch ex As Exception
        MsgBox("文件异常", ex.ToString)
    End Try
End Sub

由下图可知,已创建新目录成功

相关推荐
geovindu13 小时前
CSharp: Iterative Algorithms
开发语言·后端·算法·c#·.net·迭代算法
geovindu3 天前
CSharp: Flyweight Pattern
开发语言·后端·c#·.net·享元模式·结构型模式
驰骋工作流3 天前
请假流程:六款.NET工作流引擎实现方式对比
.net·ccflow·工作流引擎二开·.net工作流引擎对比
WarPigs3 天前
.NET项目app.Config笔记
c#·.net
海盗12344 天前
微软技术周报——2026-07-22
microsoft·c#·.net
海盗12344 天前
微软技术日报 ——2026-07-21
microsoft·c#·.net
半亩码田4 天前
【.NET新特性·第8篇】.NET 9 AI 构建基块:Microsoft.Extensions.AI
人工智能·microsoft·.net
Ctrl+Z侠4 天前
.NET WebApi Windows / Linux Docker 全链路压测与瓶颈定位 0 到 1 教程
linux·windows·.net
慧都小妮子4 天前
Aspose.CAD for .NET 26.6 更新发布
pdf·.net·3d渲染·cad·pdf导出·ifc编辑
夜莺悠吟5 天前
关于对 C# 中 ImplicitUsings,GlobalUsings 的讨论
c#·.net