![MACROMEDIA COLFUSION MX 7-CFML Reference Download Page 628](http://html1.mh-extra.com/html/macromedia/colfusion-mx-7-cfml/colfusion-mx-7-cfml_reference_3310974628.webp)
628
Chapter 3: ColdFusion Functions
GetProfileString
Description
Gets an initialization file entry.
An initialization file assigns values to configuration variables, also known as entries, that are set
when the system boots, the operating system comes up, or an application starts. An initialization
file has the suffix INI; for example, boot.ini, Win32.ini.
Returns
An entry in an initialization file, as a string. If there is no value, returns an empty string.
Category
System functions
Function syntax
GetProfileString
(
iniPath
,
section, entry
)
See also
GetProfileSections
,
GetProfileString
,
SetProfileString
Parameters
Example
<h3>GetProfileString Example</h3>
Uses GetProfileString to get the value of timeout in an initialization file.
Enter
the full path of your initialization file, and submit the form.
<!--- If the form was submitted, it gets the initialization path and timeout
value specified in the form --->
<cfif Isdefined("Form.Submit")>
<cfset IniPath = FORM.iniPath>
<cfset Section = "boot loader">
<cfset timeout =
GetProfileString(IniPath, Section, "timeout")
>
<h4>Boot Loader</h4>
<!--- If no entry in an initialization file, nothing displays --->
<p>Timeout is set to: <cfoutput>#timeout#</cfoutput>.</p>
</cfif>
<form action = "getprofilestring.cfm">
<table cellspacing = "2" cellpadding = "2" border = "0">
<tr>
<td>Full Path of Init File</td>
<td><input type = "Text" name = "IniPath" value = "C:\myboot.ini">
</td>
</tr>
Parameter Description
iniPath
Absolute path (drive, directory, filename, extension) of initialization file; for example,
C:\boot.ini
section
Section of initialization file from which to extract information
entry
Name of value to get
Summary of Contents for COLFUSION MX 7-CFML
Page 1: ...COLDFUSION MX7 CFML Reference...
Page 20: ...20 Chapter 1 Reserved Words and Variables...
Page 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Page 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Page 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Page 411: ...cftable 411 cftable body html...
Page 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Page 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Page 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Page 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Page 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Page 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 903: ...Val 903 value Is the beginning numeric name form...
Page 932: ...932 Chapter 3 ColdFusion Functions...
Page 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Page 962: ...962 Chapter 5 Application CFC Reference...
Page 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...