ASP@Workshop
HOME > ASP サンプル集 > テキストファイルを書き込む
テキストファイルを書き込む

サンプルソース

<%
Set objFso = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFso.OpenTextFile("c:\b.txt", 2, True)

If Err.Number > 0 Then
    Response.Write "Open Error"
Else
    objFile.WriteLine "書き込む文字列です。"
End If

objFile.Close
Set objFile = Nothing
Set objFso = Nothing
%>

解説

Scripting.FileSystemObjectはファイル操作をするオブジェクトです。
WriteLineでテキストファイルを書き込みます。


関連する内容



スポンサードリンク



Copyright (C) 2006-2008 ASP@Workshop All rights reserved.