テキストファイル

  



  
<SCRIPT language=VBScript>

' ----------------------------------------------------------
' 定数定義
' ----------------------------------------------------------
Const ForReading = 1

' ----------------------------------------------------------
' オブジェクト用変数定義
' ----------------------------------------------------------
Dim fs,fh

' ----------------------------------------------------------
' ファイルシステムオブジェクト作成
' ----------------------------------------------------------
Set fs = CreateObject( "Scripting.FileSystemObject" )

' **********************************************************
' テキストファイルを一度に全て読み込む
' **********************************************************
Function ReadAllText( strPath )

   Set fh = fs.OpenTextFile( strPath, ForReading )

   ReadAllText = fh.ReadAll

End Function

</SCRIPT>

<HTML>
<BODY>

<SCRIPT language=VBScript>

	Call document.write( ReadAllText( "D:\lightbox\Text\body.txt" ) )

</SCRIPT>


</BODY>
</HTML>

  



  



  
<SCRIPT language=VBScript>

' ----------------------------------------------------------
' 定数定義
' ----------------------------------------------------------
Const ForReading = 1

' ----------------------------------------------------------
' オブジェクト用変数定義
' ----------------------------------------------------------
Dim fs,fh

' ----------------------------------------------------------
' ファイルシステムオブジェクト作成
' ----------------------------------------------------------
Set fs = CreateObject( "Scripting.FileSystemObject" )

' **********************************************************
' テキストファイルを一度に全て読み込む
' **********************************************************
Function ReadAllText( strPath )

	Dim Data

	Set fh = fs.OpenTextFile( strPath, ForReading )

	retstring = ""
	Do While not fh.AtEndOfStream
		Data = Split( fh.ReadLine, "," )
		retstring = retstring & "<" & Data(0) & " type=" & Data(1) & " name=" & Data(2)
		if Ubound( Data ) > 2 then
			retstring = retstring  & " value=" & Data(3) & ">"
		else
			retstring = retstring & ">"
		end if
	Loop
 	ReadAllText = retstring

	Call fh.Close()


End Function

</SCRIPT>

<HTML>
<BODY>

<SCRIPT language=VBScript>

	Call document.write( ReadAllText( "C:\VS6\実務シュミレーション\body.txt" ) )

</SCRIPT>


</BODY>
</HTML>

  



  

  
<HTML>
<HEAD>
	<META HTTP-EQUIV="Content-Type" Content="text/html; charset=shift_jis">
</HEAD>
<FRAMESET rows="*">
	<FRAME name="Input" src="input.htm" APPLICATION="yes">
</FRAMESET>
</HTML>

  



  

  
<SCRIPT language=VBScript>

' ----------------------------------------------------------
' 定数定義
' ----------------------------------------------------------
Const ForReading = 1, ForWriting = 2

' ----------------------------------------------------------
' オブジェクト用変数定義
' ----------------------------------------------------------
Dim fs,fh

' ----------------------------------------------------------
' ファイルシステムオブジェクト作成
' ----------------------------------------------------------
Set fs = CreateObject( "Scripting.FileSystemObject" )

' ----------------------------------------------------------
' 変数
' ----------------------------------------------------------
' **********************************************************
' カレントディレクトリ取得
' **********************************************************
Function GetCurrentDir( )

	CurrentDir = location
	CurrentDir = Replace( CurrentDir, "file:///", "" )
	CurrentDir = Replace( CurrentDir, "input.htm", "" )
	CurrentDir = Replace( CurrentDir, "/", "\" )

	GetCurrentDir = CurrentDir

End Function

' **********************************************************
' 基本セット作成
' **********************************************************
Function CreateSet()

	Set fh = fs.OpenTextFile( GetCurrentDir( ) & "game.hta", ForWriting, True )

	fh.WriteLine "<HTML>"
	fh.WriteLine "<HEAD>"
	fh.WriteLine "<META HTTP-EQUIV=""Content-Type"" Content=""text/html; charset=shift_jis"">"
	fh.WriteLine "</HEAD>"
	fh.WriteLine "<FRAMESET rows=""*"">"
	fh.WriteLine "<FRAME name=""Input"" src=""start.htm"" APPLICATION=""yes"">"
	fh.WriteLine "</FRAMESET>"
	fh.WriteLine "</HTML>"

	Call fh.Close()

	Set fh = fs.OpenTextFile( GetCurrentDir( ) & "start.htm", ForWriting, True )

	fh.WriteLine "<S" & "CRIPT language=VBScript>"
	fh.WriteLine "</S" & "CRIPT>"
	fh.WriteLine ""
	fh.WriteLine "<HTML>"
	fh.WriteLine "<HEAD>"
	fh.WriteLine "<META HTTP-EQUIV=""Content-Type"" Content=""text/html; charset=shift_jis"">"
	fh.WriteLine "<STYLE type=""text/css"">"
	fh.WriteLine "IMG	{ position:absolute }"
	fh.WriteLine "INPUT	{ position:absolute }"
	fh.WriteLine "</STYLE>"
	fh.WriteLine "</HEAD>"
	fh.WriteLine "<BODY id=""Body"">"
	fh.WriteLine "</BODY>"
	fh.WriteLine "</HTML>"

	Call fh.Close()


End Function

</SCRIPT>

<HTML>
<BODY>

<INPUT type=button value="基本セット作成" onClick='Call CreateSet()'>


</BODY>
</HTML>

  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ