A
Anthony
Hello Everyone,
I've raised a similar question in the group before but am still puzzled by
this behavior and I'd like to understand what is going on here. If anyone
would be so kind as to take a shot at explaining this, I'd be most greatful.
I'm writing an application for Windows Mobile that will store its
configuration file in the \ApplicationData folder of the device. Let's name
the configuration file 'myApp.conf'. At first, I thought this code would
work:
Dim oFile as New
StreamReader(System.Enviroment.GetFolderPath(Enviroment.GetSpecialFolder.ApplicationData)
& "\myApp.conf")
However, if I print the filename of oFile in a messagebox, I get something
like '26\myApp.conf' which, obviously isn't the folder name I'm looking for
in that path.
So I convert the path to a string using like this
oFile = New
StreamReader(CStr(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
& "\myApp.conf"))
And everything works fine.
Can anyone explain why these methods would return an integer instead of a
string until they are explicitly converted to a string? Am I missing
something critical here or is this just one of those weird and goofy things?
Thanks!
Anthony
I've raised a similar question in the group before but am still puzzled by
this behavior and I'd like to understand what is going on here. If anyone
would be so kind as to take a shot at explaining this, I'd be most greatful.
I'm writing an application for Windows Mobile that will store its
configuration file in the \ApplicationData folder of the device. Let's name
the configuration file 'myApp.conf'. At first, I thought this code would
work:
Dim oFile as New
StreamReader(System.Enviroment.GetFolderPath(Enviroment.GetSpecialFolder.ApplicationData)
& "\myApp.conf")
However, if I print the filename of oFile in a messagebox, I get something
like '26\myApp.conf' which, obviously isn't the folder name I'm looking for
in that path.
So I convert the path to a string using like this
oFile = New
StreamReader(CStr(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
& "\myApp.conf"))
And everything works fine.
Can anyone explain why these methods would return an integer instead of a
string until they are explicitly converted to a string? Am I missing
something critical here or is this just one of those weird and goofy things?
Thanks!
Anthony