I am creating a windows form application with a browser object in it for our users to easily access an employee search web application we have. We recently updated the application from VB6 to VB.Net and the old shell it used does not quite fit the dimensions of the new version. The old shell was never documented and the source code can not be found, so I am creating a new one.
This form application will be accessed from a network share and should not be installed, so I am using the available online only option. This creates a .application file that executes the file without adding any shortcuts or add/remove programs files. However, the only way I've been able to make it read from the text file is by using an absolute file path. I want to use a relative file path and simply put the text file into the same folder as the .application file that is made when I publish the application. That way, if we move the application and the text file for any particular reason, the filepath does not need to change.
The current C# code to read:
StreamReader siteList = new StreamReader("\\\\ercfs01\\ERCPhone\\site.lst");
string urlString = siteList.ReadLine();
Uri url = new Uri(urlString);
browserPhone.Url = url;
I've tried different variations to try and make it read from site.lst located in whatever folder I place the published application into, but so far I have only had issues and I'm not finding any applicable information yet.
Any help is greatly appreciated.