It seems that ActiveWorkspace.ConfigurationVariableValue() translates / to \\ when returning the values of a variable. If I look in [Workspace - Configuration] the / is replaced with \. My string could contain either so I really need to get the original string (it's a password key). Is there any other way to get the original the value?
In the ucf-file: EAAAAMjKgUkIPwSmU/dpKk+pyvuYSxObomZLQN+NoYNkgLh1
In MicroStation: EAAAAMjKgUkIPwSmU\dpKk+pyvuYSxObomZLQN+NoYNkgLh1
In C#: EAAAAMjKgUkIPwSmU\\dpKk+pyvuYSxObomZLQN+NoYNkgLh1
/Krister
Krister,
Michael is correct. A MicroStation configuration file is not the best location to store special character data, but is a great facility to create and use values that are string parts that can be equated to either a file name, directory, or simple data type for display or interpretation.
When config var "values" are read into MicroStation, MicroStation will convert any values containing "forwardslashes" to operating specific directory separators (e.g. For Windows a directory seperator is "\", not "/" that is preferred and used in MicroStation config files). Caution is taken on our part a.) not to modify the original config file when doing so (in memory), and b.) process UNC mounts and URLs as expected.
You have at least two choices available. a.) you could use C# String.Replace() to safely replace the backslashes to forward slashes for your in memory copy of the original buffer, or b.) store data containing special characters in an alternate location.
HTH,
Bob
Answer Verified By: Krister Surell
For now a do a Replace but it seems that I need to move this to another file. Even though config files are mainly for path and settings it would still be nice to have an option if it should translate slashed or not.
Regards,Krister
Owner consultant at Surell Consulting AB