title: vb.net Serialize and Deserialize a list(of string) using json or other method
body: <p>I'm sure this is simple thing, but i've been staring at it for so long I can't think straight!  :)</p>
  
  <p>I am getting a list of directories, I want to serialize this list, i will then save into a database field as nvartext and then later on pull the data back out and convert back to a list of string.  I'm having trouble on the DEserialize portion.</p>
  
  <pre><code>Sub SerializeDeserializeMyList
      Dim myDirectories as list(of String) = GetDirectories("C:\")
      Dim JSONString as string = JsonConvert.SerializeObject(MyDirectories)
  
      'ok new let's try to DEserialize the string
  
      'THIS DOES NOT WORK -&gt;
      Dim myNewDirectories as list(of string) = jsonconvert.deserializeobject(of string)(JSONString)
  End Sub
  
  'this part works fine but i'm open to other suggestions on this    
  Public Function GetDirectories(ByVal path As String) As List(Of String)
      Dim subfolders As New List(Of String)
  
      For Each subfolder As String In IO.Directory.GetDirectories(path)
          subfolders.Add(subfolder)
  
          Try
              subfolders.AddRange(GetDirectories(subfolder))
          Catch ex As UnauthorizedAccessException
              'Ignore this folder and move on.
          End Try
      Next subfolder
  
      Return subfolders
  End Function
  </code></pre>
  
  <p>Any thoughts would be great appreciated.  I see bunch of entries for json deserialization for more complex objects, but nothing for a simple list of string.</p>
  
  <p>Thank you in advance!
  Chris</p>