|
-
February 3rd, 2009, 06:32 AM
#1
INI file and UserProfile
Hi,
Is there a way to manually store a value to get the user profile path of a user in the INI file?
Thanks
-
February 3rd, 2009, 11:00 AM
#2
Re: INI file and UserProfile
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%.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 3rd, 2009, 11:19 PM
#3
Re: INI file and 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
-
February 4th, 2009, 08:41 AM
#4
Re: INI file and UserProfile
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.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 8th, 2009, 12:39 AM
#5
Re: INI file and UserProfile
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
-
February 8th, 2009, 08:41 AM
#6
Re: INI file and UserProfile
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;......."
Last edited by PeejAvery; February 8th, 2009 at 08:43 AM.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 8th, 2009, 11:59 PM
#7
Re: INI file and UserProfile
I tried that too. But it takes the whole string as string.
-
February 9th, 2009, 09:08 AM
#8
Re: INI file and UserProfile
 Originally Posted by shers
But it takes the whole string as string.
What? That sentence makes no sense.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 9th, 2009, 11:47 AM
#9
Re: INI file and UserProfile
-
February 9th, 2009, 11:50 AM
#10
Re: INI file and UserProfile
 Originally Posted by PeejAvery
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 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
-
February 10th, 2009, 04:34 AM
#11
Re: INI file and UserProfile
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|