Every time, no matter what path I use, I am getting
Access to the path 'blahblah' is denied. I have moved the data into my user folder in order to be sure to actually have access. I have run Visual Studio as Administrator, and I have put this in appmanifest
Expand|Select|Wrap|Line Numbers
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Expand|Select|Wrap|Line Numbers
- Imports System
- Imports System.IO
- Public Class Form1
- Private Sub Merge_cmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Merge_cmd.Click
- Dim Directory As New IO.DirectoryInfo(Me.FolderPath_txt.Text)
- Dim allFiles As IO.FileInfo() = Directory.GetFiles("*.*")
- Dim singleFile As IO.FileInfo
- Try
- For Each singleFile In allFiles
- File.AppendAllText(Me.TargetFile_txt.Text, File.ReadAllText(Me.FolderPath_txt.Text))
- Next
- Catch ex As Exception
- Debug.WriteLine("Exception Information: " & vbCrLf & ex.Message)
- Finally
- 'Resume Next
- End Try
- End Sub
- End Class
c:\users\Jim\Final
The output file (Me.TargetFile_txt.Text) is
c:\users\jim\dictionary.txt
Here is the result from the debug window
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
Exception Information:
Access to the path 'c:\users\Jim\Final' is denied.
Help, please.
Thanks,
jim