ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
外部ファイルよりテキスト取得 ( ASP )
日時: 2015/07/04 19:57
名前: lightbox



拡張子:
' ******************************************************
' テキストファイルより文字列を取得
' ******************************************************
Function GetText(path, rpl)

	Dim fs,handle,text
	Set fs = Server.CreateObject("Scripting.FileSystemObject")

	Set handle = fs.OpenTextFile( _
		Server.MapPath(path), _
		1 _
	)
	text = handle.ReadAll()
	handle.Close()

	Dim i
	Dim str

	For i = 0 To Ubound(rpl)
		str = "$" & Right("00" & (i+1), 2)
		text = Replace(text, str, rpl(i))
	Next

	GetText = text

End Function
メンテナンス

Web ページの中継表示 ( No.1 )
日時: 2015/07/04 19:59
名前: lightbox


日時: 2015/07/04 19:59
名前: lightbox
拡張子:
<%
Response.ExpiresAbsolute=#May 31,2000 23:59:59#

Dim strMessage

' **********************************************************
' MODEL
' **********************************************************
function DispPage()

	if Trim( Request.Form("url") ) = "" then
		strMessage = "URL を入力して下さい"
		Exit Function
	end if

	Set Http = Server.CreateObject("Msxml2.ServerXMLHTTP")
	on error resume next
	Call Http.Open("GET", Request.Form("url"), False )
	if Err.Number <> 0 then
		strMessage = "URL に誤りがあります"
		Exit Function
	end if
	on error goto 0

	Http.Send

	Response.BinaryWrite Http.responseBody
	Response.End

end function

' **********************************************************
' CONTROL
' **********************************************************
	if Request.Form( "send" ) = "表示" then
		Call DispPage()
	end if

%>

<!-- **********************************************************
  VIEW
*********************************************************** -->
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=Shift_JIS">
</HEAD>
<FORM method=POST>
表示するWebページの URL
<INPUT
	size=100
	type=text
	name=url
	value="<%= Request.Form( "url" ) %>">
<INPUT type=submit name=send value="表示">
<HR>
<%= strMessage %>
</FORM>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス