amin joon
پنج شنبه 03 دی 1383, 10:22 صبح
با سلام
نحوه ی ایجاد دایرکتوری
من در یکی از topic ها قطعه برنامه ی زیر رو پیدا کردم ولی نمیدونم که عنصر Directory که استفاده کرده از چه نوعی هست.لطفآ راهنمایی کنید.
Private Sub butCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butCreate.Click
Dim strPath As String
strPath = Server.MapPath(Request.ApplicationPath) & "\" & txtName.Text
If Directory.Exists(strPath) Then
litnameexist.Text = "<p>The name " & txtName.Text & _
" already exists. Please choose a different one.</p>"
Return
Else
Try
Directory.CreateDirectory(strPath)
Session("Path") = strPath
Server.Transfer("filemanager.aspx")
Catch ex As System.UnauthorizedAccessException
' Server.Transfer("NotAuthorized.aspx")
End Try
End If
End Sub
نحوه ی ایجاد دایرکتوری
من در یکی از topic ها قطعه برنامه ی زیر رو پیدا کردم ولی نمیدونم که عنصر Directory که استفاده کرده از چه نوعی هست.لطفآ راهنمایی کنید.
Private Sub butCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butCreate.Click
Dim strPath As String
strPath = Server.MapPath(Request.ApplicationPath) & "\" & txtName.Text
If Directory.Exists(strPath) Then
litnameexist.Text = "<p>The name " & txtName.Text & _
" already exists. Please choose a different one.</p>"
Return
Else
Try
Directory.CreateDirectory(strPath)
Session("Path") = strPath
Server.Transfer("filemanager.aspx")
Catch ex As System.UnauthorizedAccessException
' Server.Transfer("NotAuthorized.aspx")
End Try
End If
End Sub