0

フォームからテキスト ファイルにテキストを送信するためにオンライン ソースから収集できるコードをいくつか書きました。おそらくフォルダパスと関係がありますが、私にはわかりません。これに関する方向性を探しているだけです。

私の ASP フォーム コードは次のとおりです。

<form method="get" action="simpleform.asp">

<br/>
<i>Please include your initials and date with the bug report</i> 
<br/>
<br/>
<b>Bug</b> <input type="text" name="bug">

<input type="submit" value="Submit Bug Report">
</form>
<br/>

テキストをファイルにコミットする ASP コードは次のとおりです。

<html>
<body>
Thanks for the report! To report another bug <a href="BugReportPage.asp">click         here</a>.

<%
Dim idea

dim fs,f

set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile("G:\General\EM_Wiki\WikiBug\bugreport.txt",8,true)

idea= Request.QueryString("bug")


f.WriteLine(bug)
f.Close
set f=nothing
set fs=nothing

%>
</body>
</html>

誰かにとって意味があり、正しい方向に私を向けることができることを願っています, ありがとう!

4

2 に答える 2

1

実際のコンテンツは variableideaではなくvariable にありbugます。bugクエリ文字列の単なるインデックスです。flushまた、ストリームが必要になる場合があります。

flushファイルを閉じる前にメソッドを使用する、ef.flush()

f.WriteLine(idea)
//your more writing
f.flush()
f.Close

ここにmsdnリンクがあります

http://msdn.microsoft.com/en-us/library/system.io.streamwriter.flush.aspx

于 2013-10-14T14:47:47.523 に答える