Re: Packing a C# project.
"Jan Niklas Hasse" <[email protected]> Wed, 11 Jun 2008 21:16:02 +0200
| Newsgroups | gmane.comp.autopackage.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jun 11, 2008 at 9:11 PM, Neil Munro <[email protected]> wrote: > Damn run into an issue, not sure if anyone can help me solve it though, > since I am removing all the code i previously entered which I did not need. > I have a bug in that I specify a path > > string sFileName = "~/.config/warp/feeds.txt"; > FileStream Feeds = new FileStream( sFileName, FileMode.Open, FileAccess.Read > ); > StreamReader Reading = new StreamReader( Feeds ); > > But I get this error at runtime: > Could not find a part of the path > "/home/niadh/Dev/warp/trunk/WarpCoreV2/bin/Debug/bin/~/.config/warp/feeds.txt".. > > Obviously files are still being treated relatively, anyone know how to work > around this? The problem is you can also name folders ~. Using ~ for your home directory is only valid in a bash. As Isak said, you should call Environment.GetSpecialFolder(Environment.SpecialFolder.Personal) to get the path to the users home directory. --------------------------------------------------------------------- To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected] For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected]