You could create a directory in asp .net using CreateDirectory Function. The below code creates a directory. I am using this code in a webservice and it works fine
Public Function CreateDirectory(ByVal DirectoryName As String) As String
If Directory.Exists(Server.MapPath(DirectoryName)) Then
Return "Directory Already Exist"
Else
Try
Directory.CreateDirectory(Server.MapPath(DirectoryName))
Dim oMenu As New cMenu
Catch ex As Exception
Return "Failue" + ex.ToString
End Try
End If
Return "Success"
End Function
To Call the above code
CreateDirectory(/ASP/C++)
Please pass the path. This would create a directory under ASP.
I think the code is self explanatory
|