nubs Level: Trainee
 Registered: 15-07-2005 Posts: 2
|
Re: Publishing worries
Cheers, that was useful. The problem with my program is when it is deployed. I'm using VB Express 2005 Beta. I have a error checker that's a statement which check it file has been found the loads it into the label else returns a statement indicating an error and shows where the file is expected to be.
When the application is published, on running it the files cannot be located and program indicates they are stored in some temporary folders of the Local Settings folder of the PC hard drive. This is weird, i dont know why and where the deployement puts the files and why it does not read from the application current directory. This my code:
Dim FILE_NAME As String = Environment.CurrentDirectory
FILE_NAME = FILE_NAME & "\file.txt"
Dim TextLine As String = ""
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Do While objReader.Peek() <> -1
TextLine = TextLine & objReader.ReadLine() & vbNewLine
Loop
Label5.Text = TextLine
Else
MsgBox("Runtime Error. " & Chr(13) & Chr(10) & FILE_NAME)
End If
Or how do i change the settings to it deploys the files to the folder selected for installation? Thanks.
|