如果输入c;\ttt表示正确,如果输入ttt则错误

解决方案 »

  1.   

    if dir("c:\ttt")<>"" then
       存在
     else
       不存在
    end if
      

  2.   

    sLoc是输入的路径,
    If Dir(sLoc, vbDirectory) = "" Then
            MkDir (sLoc)
    End If
    如果我输入ttt,他会在C:\Program Files\Microsoft Visual Studio\VB98下面声成ttt目录
      

  3.   

    if len(dir("c:\ttt"))>0 then
       存在
     else
       不存在
    end if
      

  4.   

    if len(dir("c:\ttt"))>0 then
       存在
     else
       不存在
    end if
      

  5.   

    '调用方法:MsgBox IsPath("C:\Windows")
    Public Function IsPath(ByVal Path As String) As Boolean
        On Error GoTo 1
        IsPath = False
        MkDir Path
        RmDir Path
        Exit Function
    1:
        IsPath = True
    End Function
      

  6.   

    if dir("c:\ttt")<>"" then
       存在
     else
       不存在
    end if