CSDN博客

img kevin521

递归创建文件名

发表于2004/9/14 15:12:00  712人阅读

Public Function getname(ByVal name As String, ByVal num As String) As String
        Dim pathstring As String = "f:/" & name & num.ToString & ".txt"
        If File.Exists(pathstring) Then
            num += 1
            Return getname(name, num)
        Else
            File.Create(pathstring)
            Return pathstring
        End If
    End Function
0 0

相关博文

我的热门文章

img
取 消
img