Question : Access Denied with Process.start when reading a text file.

I'm trying to open a log file from an applications, I'm using the native listview control in vb.net in teh dblclick event the file path and name is correctly found, but when feeding to the start process function I get an 'Access is denied' error, any ideas?  The value of the file/path is i.e.

1:
2:
3:
4:
5:
6:
7:
LogFilePaht = F:\Software Source Code\Virtual Web Software\Charlotte Burn Permit\bin\Debug\log_files\bp-8-24-2010.log

    Private Sub LogFileList_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LogFileList.DoubleClick
        Dim LogFilePath As String = LogFileList.SelectedItems(0).ToString
        System.Diagnostics.Process.Start(LogFilePath)
    End Sub


.log is associated with a valid applications.

Answer : Access Denied with Process.start when reading a text file.

Aha... I missed that part too. In listview, you should use this:
       Dim LogFilePath As String = LogFileList.SelectedItems(0).Text.ToString

Random Solutions  
 
programming4us programming4us