我在编写 ColdFusion 10 代码时遇到问题。它只是一个基本的在网络驱动器上创建一个目录文件夹。该页面有一个文本框,您输入名称单击下一步,然后就可以了,但是由于某种原因,我在网上找不到类似的东西。
<cfparam name="selectedDirectory" default="" />
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Project Directory Wizard</TITLE>
</HEAD>
<BODY>
<cfinclude template="header.cfm" />
<cfinclude template="mainarea.cfm" />
<cfset VARIABLES.directoryPath = '\\Volz\C$\test' />
<cfset VARIABLES.newDirName = 'bob' />
<form action="results.cfm" method="post">
<input type="text" name="newDirName" />
<button type="submit">Add Directory</button>
</form>
<cfif cgi.request_method EQ "post">
<cfif directoryExists(VARIABLES.directoryPath & '\' & form.newDirName )>
The directory already exists.
<cfelse>
<cfset directoryCreate(VARIABLES.directoryPath & '\' & form.newDirName)>
The directory didn't exist, but it does now!"
</cfif>
</cfif>
</BODY>
</HTML>