Setting the initial directory of an SaveFileDialog?

前端 未结 14 2168
一个人的身影
一个人的身影 2020-12-01 10:05

I\'d like a SaveFileDialog with the following behavior:

  • The first time you open it, it goes to \"My Documents\".

  • Afterwards, it goes to the

14条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 10:59

    'In terms of saving an output file to a desired directory in vb.net, 'the following was the way I found that worked like a charm:

    Dim filcsv As String = fileNamey.Replace(".txt", "_Denied2.csv")
    Dim filcsv2 As String = fileNamey.Replace(".txt", "_Approved2.csv")
    
    Dim outputDirectory As String = "C:\Users\jlcmil\Documents\EnableMN\output\"
    Dim totalPath As String = System.IO.Path.Combine(outputDirectory, filcsv)
    Dim totalPath2 As String = System.IO.Path.Combine(outputDirectory, filcsv2)
    
    Dim outDenied As StreamWriter = New StreamWriter(totalPath)
    Dim outApproved As StreamWriter = New StreamWriter(totalPath2)
    

提交回复
热议问题