title: How to specify path using open file dialog in vb.net?
body: <p>In the first start of my application I need to specify a path to save some files to it. But in the open file dialogue it seems like that I have to select a file to open. How can I just specify a folder without oppening a file
  like C:\config\</p>
  
  <p>Here is my code</p>
  
  <pre><code>If apppath = "" Then
          Dim fd As OpenFileDialog = New OpenFileDialog()
          fd.Title = "Select Application Configeration Files Path"
          fd.InitialDirectory = "C:\"
          fd.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"
          fd.FilterIndex = 2
          fd.RestoreDirectory = True
          If fd.ShowDialog() = DialogResult.OK Then
              apppath = fd.FileName
          End If
          My.Computer.FileSystem.WriteAllText(apppath &amp; "apppath.txt", apppath, False)
      End If
  </code></pre>
  
  <p>I need to select a file in order for it to work, but I just want to select a folder. So what's the solution?</p>