Results 1 to 2 of 2

Thread: error message

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    error message

    The code below gave me this error message

    "Could not complete operations on some files and directories. See the Data property of the exceptions for more details"

    Where do I find the Data property of the exceptions so I can troubleshoot what is causing this error?

    Code
    **********
    directory_name = "robotic_surfing_vb 2008_scripts"
    My.Computer.FileSystem.CopyDirectory("C:\" & directory_name, "T:\Backup\Laptop 3 - Dell D610 - All Data\" & Format(Now, "MMddyy") & "\" & directory_name, True)

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: error message

    You have to collect it when the error occurs ...

    vb.net Code:
    1. Dim s As New System.Text.StringBuilder
    2.         Try
    3.             Dim directory_name = "robotic_surfing_vb 2008_scripts"
    4.             My.Computer.FileSystem.CopyDirectory("C:\" & directory_name, "T:\Backup\Laptop 3 - Dell D610 - All Data\" & Format(Now, "MMddyy") & "\" & directory_name, True)
    5.         Catch ex As Exception
    6.             Dim ErrorDict = ex.Data
    7.             For i = 0 To ErrorDict.Count - 1
    8.                 s.AppendLine(ErrorDict.Keys(i).ToString & ": " & ErrorDict.Values(i).ToString)
    9.             Next
    10.         End Try
    11.         TextBox1.Text = s.ToString
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width