Does anyone know how to access values stored in the web.config on the server from a client customization? The reason I ask is that I have some variables I would like to store on the server outside of the customization. I suppose I could store the values in a UD table but was hoping to save it in a central file.
I don’t think I’d put variable like that in the web.config. I’d put those in a UD table like @Evan_Purdy said. Putting them in the web.config could be messy come upgrade time.
Thanks everyone for the ideas. A UDCode will probably work in this case. However, I am still left wondering if there is a way to access the web.config or even the client.sysconfig from a client customization
My goal is to make it as universal as possible so the client code is portable. My preference is to store it uniquely on the application server and the client would not contain any file pathing. In my mind, this should simplify changing
servers / upgrades, etc
And if you were really ambitious, you could use functions like Directory.GetLogicalDrives(), Directory.GetDirectories(), etc… to search and find the web.config file.
Thanks for the information! I can locate System.Web.dll in the .NET 4.0 folder (C:\Windows\Microsoft.NET\Framework64\v4.0.30319). I assume I copy this DLL into the client folder to allow the reference to take place (or update xml for assembly reference)…
Two questions-
My 2 cents - never ever give the client access to server files! If UDCodes isnt acceptable, might I suggest either a dedicated DB or shared folder with security.
Yes that makes sense. I was just hoping that if contents of one of the .config files were already stored in memory or accessible via adapters that I could utilize them. I will be storing credentials to an external site and was hoping to make them relatively easy to update if they change and difficult to access for users who gain access to our database/interface without making things overly complicated.
Just to be clear, when you say “client”, are you referring to code for your specific client (aka your customer), or the client program that runs on a users workstation?