Name

SetProfileString

Synopsis

                  
                  
                  SetProfileString(inipath, section, entry, value)

Sets the value of a profile string entry in section of the initialization file specified by inipath. If section does not exist, ColdFusion creates it first. If the operation is successful, an empty string is returned. If not, an exception is thrown. Here’s an example that changes the number of threads used by the Verity K2 server in the k2server.ini file:

<cfset MyPath = "c:\cfusionmx\lib\k2server.ini">
<cfset MySection = "Server">
<cfset MyEntry = "numThreads">
<cfset MyValue = "6">
   
<cfset MyProfileString = SetProfileString(MyPath, MySection, MyEntry, MyValue)>
<cfoutput>
<b>Path:</b> #MyPath#<br>
<b>Section:</b> #MySection#<br>
<b>Entry:</b> #MyEntry#<br>
<p><b>Profile String:</b> #MyValue#
</cfoutput>

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.