I need to know how to export at txt file to the desktop using StreamWriter. The code looks like this currently.
This works perfectly fine so long as the application is installed on the desktop. The issue is that this will be a program used by multiple people so it will be loaded on a network drive. So how can I code it to save the txt file to the desktop of the respective user instead of the network drive it is accessed from?
Private Sub ExportNoteHistoryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportNoteHistoryToolStripMenuItem.Click Dim History As IO.StreamWriter = New IO.StreamWriter(application.StartupPath & "\History.txt") History.Write(TextBox8.Text) History.Dispose() End Sub
This works perfectly fine so long as the application is installed on the desktop. The issue is that this will be a program used by multiple people so it will be loaded on a network drive. So how can I code it to save the txt file to the desktop of the respective user instead of the network drive it is accessed from?