encode| Syntax Script encoder Syntax 
 
Screnc [/S] [f] [/XL] [/L deflanguage] [/e defextension] inputfile outputfile 
 
Argument 
Description 
 
/s 
Optional. Switch that specifies that script encoder are to work silently; That is, produce no screen output. If omitted, the default is to provide verbose output. 
 
/F 
Optional. Specifies that the ' input ' is overwritten by the output file. This option destroys your original input source file. If omitted, the output file is not overwritten. 
 
/xl 
Optional. Specifies that the < @language > directive isn't added at the top of. asp files. If omitted, the < @language > directive is added to all. asp files. 
 
/L Deflanguage 
Optional. Specifies the default scripting language (JScript or VBScript) to use during encoding. Script blocks within the file being encoded that does not contain a language attributes are assumed to is of this specified l Anguage. If omitted, the JScript is the default language for HTML pages and scriptlets, while the in-VBScript is the default for ASP. For plain text files, the file extension (either. js or. vbs) determines the default scripting language. 
 
/e defextension 
Optional. Associates the input file with a specific file type. Use this switch when the input file ' s extension doesn ' t make the file type obvious; The ' is ', when the ' input ' is ' not ' recognized extensions, but the file content does fall into one of The recognized types. There is no default to this option. If a file with an unrecognized extension are encountered and this option are not specified, the script encoder fails for tha T unrecognized file. Recognized file extensions are. asa,. asp,. CDX,. htm,. html,. js,. SCT, and. vbs. 
 
Inputfile 
Required. The name of the input file to is encoded, including any necessary path information relative to the current directory. 
 
OutputFile 
Required. The name of the output file to is produced, including any necessary path information relative to the current directory. 
 
 
 
 
 
-------------------------------------------------------------------------------- 
 
Figure 3 Encoding a Page 
 
 
 
Public Sub Encodepage () 
' Sample encoder 
' Andrew Clinick 1999 
' Obviously this code could does with some error trapping etc 
' But it should give the basics to get started 
 
 
Dim strHTML as String 
' Get the Frontpage document 
Dim MyDoc as FPHTMLDocument 
' Create a new instance of the Scripting.encoder object 
Dim Myencoder as New scripting.encoder 
' Get the current active document 
Set mydoc = ActiveDocument 
' Get the HTML for the ' Active document 
strHTML = mydoc. DocumentHTML 
' Call the Encodescriptfile method with the HTML 
strHTML = Myencoder.encodescriptfile (". htm", strhtml, 0, "") 
' Set the documenthtml to is the return HTML with encoded script 
MyDoc. documenthtml = strHTML 
' We ' re done! 
End Sub