Dim strFile2 = User & "\Documents"
Dim objFSO2 = CreateObject("Scripting.FileSystemObject")
Dim Documents = objFSO2.GetFolder(strFile2)
Documents = CDec(Documents.Size / bytesToGb)
MsgBox(Documents)
错误:
System.Security.SecurityException occurred HResult=-2146828218 Message=Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED) Source="" StackTrace: at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at ExportImport.Form1.Export_Click(Object sender, EventArgs e) in C:\Users\admin\Desktop\Export Import\ExportImport\ExportImport\Form1.vb:line 42 InnerException:
此声明提供错误:
Documents = CDec(Documents.Size / bytesToGb)
我很好奇是否有解决此错误的方法或解决方法。