戻る


ASPは非常に難しいものだと思います。
残念ですが、私にはASPを使いこなす事が出来ませんでした。

ソースだけの公開とします。

この動作確認は、ASPの使えるサーバにてお願いします。


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
  <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <TITLE>てすと</TITLE>
<% @language=vbscript %>
  </HEAD>
  <BODY MS_POSITIONING="GridLayout">
<% Response.Write "<p align='center'>項目</p><br>" %>
<%
Dim FilePath1
Dim Data(25)
Dim Data_Item(25)
Dim Data_Time(25)
Dim Data_Name, Time_H
Dim i, j, k, l, m

FilePath1 = Server.MapPath("/test.csv")

Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set FObj = FSO.OpenTextFile(FilePath1, 1, False)

Do Until FObj.AtEndOfStream
Data(i) = Split(FObj.ReadLine, ",")
i = i + 1
Loop

FObj.Close()

Data_Name = Data(0)

Response.Write "<form method='POST' action='data1.asp'>"

For j = 0 To 23
Data_Item(j) = Data(j + 1)
Data_Time(j) = Data_Item(j)(0)
Next

Set FObj = Nothing
Set FSO = Nothing
%>
<% Response.Write Data_Name(0) %>
<select NAME="Select">
<%
For k = 0 To 23
If Data_Time(k) = Data_Time(23) Then
Response.Write "<option selected value=" & k & ">" & Data_Time(k) & "</option>"
Else
Response.Write "<option value=" & k & ">" & Data_Time(k) & "</option>"
End If
Next
%>
</select>
<input type="submit" value="更新">
<br>
</form>

<% Viewer %>

  </BODY>
</HTML>
<%
Sub Viewer()

m = Request.Form("select")

%>
<table boder="0">
<tbody>
<% For l = 1 To 10 %>
<tr><td>
<% Response.Write(Data_Name(l) & _
"</td><td align='right'><a href='data" & l + 1 & ".asp'>" & _
Data_Item(m)(l) & "</a><br>") %>
</td></tr>
<% Next %>
</tbody>
</table>

<%
End Sub
%>