Hi,
Is there a way to manually store a value to get the user profile path of a user in the INI file?
Thanks
Printable View
Hi,
Is there a way to manually store a value to get the user profile path of a user in the INI file?
Thanks
What INI file are you talking about? If you want to just get the current user's profile path why not use the environment variable %UserProfile%.
Yes, I would like to know if this variable can be used in the INI file? For example, I need a string as follows:
"Q:\test;%UserProfile%\Application Data"
Can this be accomplished?
Thanks
I repeat my questions. You keep saying "the INI file"...What INI file are you talking about?
Second, any modern programming language can just plain read environment variables. If you just would use the environment variable %UserProfile%, you would have no reason to access any INI file.
I agree with you that %UserProfile% would read the user profile. But I need to get a set of paths at one stretch in a particular order as follows
Path = Q:\test;C:\Documents and Settings\shers\test;.......
where Q is a network drive.
Thanks
So why don't you just concatenate the string by using %UserProfile% plus the other parts? The language in which you plan to write this will affect how you obtain the user profile variable, but the rest is basic to programming.
Code:path = "Q:\test;" & userProfile & "\test;......."
I tried that too. But it takes the whole string as string.
What? :confused: That sentence makes no sense.Quote:
Originally Posted by shers
Have a look here as well :
http://www.codeproject.com/KB/vb/appsettings2005.aspx
I don't understand how it will expand. Please show me what I am not getting. I think it is ExpandEnvironmentStrings API to do this job :confused:
You can store anything you want too in an ini file. If this data is sensitive then you would have to encrypt it so users can't read it and copy it.
Ini files don't have to be your.ini they can be any file extension you want to use providing it doesn't clash with the other extension registered to Windows. It could be your.dll and it could be padded out with any rubbish just to make the filesize to a small dll size rather that a few Kb.