Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Exporting txt file to Desktop

$
0
0
I need to know how to export at txt file to the desktop using StreamWriter. The code looks like this currently.

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?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>