无法在vb.net中创建文件夹(目录)errr:拒绝访问路径'Docs \EIS\ITDECLARATION \INSURANCE \ 47 \'。 [英] Not able to create folders (directory) in vb.net errr: Access to the path 'Docs\EIS\ITDECLARATION\INSURANCE\47\' is denied.
问题描述
Dim filectredu As Integer = 0
Dim strFileName As String
For i = 0 To UBound(ary_t_EDU_PR_QUAL_MASTER_ID)
'' - -------------------------------------------------- -------
''---->>为文件上传制作路径:
''---------------------------------- -------------------------
Dim m_objFile As HttpPostedFile'变量保存文件
Dim m_strFileName,m_strFileExt As String'保存FileName的变量,文件扩展名
Dim m_strFolderName,m_strOldFolderName,m_strFolderName1 As String
m_objFile = Request.Files(filectredu)'获取HttpPostedFile
'检查文件存在是否有名称并且不为空
如果不存在(m_objFile是Nothing或m_objFile.FileName = 或m_objFile.ContentLength< 1)然后
m_strFileName = m_objFile.FileName'获取文件的名称
m_strFileName = Path.GetFileName(m_strFileName)
m_strFileExt = Path.GetExtension(m_strFileName)
m_strFolderName =Docs\EIS\EMPLOYEEINFO\EDU \&CompID&\>
如果不是Directory.Exists(m_strFolderName)那么
Directory.CreateDirectory(m_strFolderName)
结束如果
m_strFolderName = m_strFolderName&Trim(EMP_NO.Text)&_&Trim(t_Id)&_&Trim(t_LINE_NO)&m_strFileExt
Dim filectredu As Integer = 0
Dim strFileName As String
For i = 0 To UBound(ary_t_EDU_PR_QUAL_MASTER_ID)
''-----------------------------------------------------------
''---->> MAKING PATH for FILE UPLOAD:
''-----------------------------------------------------------
Dim m_objFile As HttpPostedFile 'Variable to hold the File
Dim m_strFileName, m_strFileExt As String 'Variable to hold the FileName, File Extension
Dim m_strFolderName, m_strOldFolderName, m_strFolderName1 As String
m_objFile = Request.Files(filectredu) 'Get the HttpPostedFile
'Check that the File exists has a name and is not empty
If Not (m_objFile Is Nothing Or m_objFile.FileName = "" Or m_objFile.ContentLength < 1) Then
m_strFileName = m_objFile.FileName 'Get the name of the file
m_strFileName = Path.GetFileName(m_strFileName)
m_strFileExt = Path.GetExtension(m_strFileName)
m_strFolderName = "Docs\EIS\EMPLOYEEINFO\EDU\" & CompID & "\"
if Not Directory.Exists(m_strFolderName) then
Directory.CreateDirectory(m_strFolderName)
end if
m_strFolderName= m_strFolderName & Trim(EMP_NO.Text) & "_" & Trim(t_Id) & "_" & Trim(t_LINE_NO) & m_strFileExt
推荐答案
这意味着您没有足够的权限访问该目录。右键单击要在其中创建文件夹的文件夹。检查安全选项卡。
That means you don't have sufficient permission for that directory. Right click on the folder inside which you are creating the folder. Check the Security Tab.
这篇关于无法在vb.net中创建文件夹(目录)errr:拒绝访问路径'Docs \EIS\ITDECLARATION \INSURANCE \ 47 \'。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!