用一个软件转换成asp.net代码根本没有办法用。
<%--
Generated by ASP2ASPX 3.1. Copyright 2002-2003 Netcoole.
ASP2ASPX home page: http://www.netcoole.com
Original File Name: D:\work\Sunshine\Web-Test\index.asp
--%><%@ Page language = "VB" codepage = 936 Debug="true"%><%
startime = Timer()
start = Request.Form("start")
destination = Request.Form("destination")
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>北京理工大学乘车路线查询</title>
<style type="text/css">
<!--
.busNO {
font-family: "宋体";
font-size: 16px;
text-decoration: none;
background-color: #FFFFFF;
text-align: center;
color: #000000;
}
table {
font-family: "宋体";
font-size: 12px;
text-decoration: none;
background-color: #FF9933;
}
tr {
font-family: "宋体";
font-size: 12px;
text-decoration: none;
background-color: #FFFFFF;
}
input {
font-family: "宋体";
font-size: 12px;
color: #FF9933;
text-decoration: none;
border: 1px solid #9933;
}
select {
font-family: "宋体";
font-size: 12px;
color: #FF9933;
text-decoration: none;
border: 1px solid FF9933;
background-color: #FFFFFF;
}
body {
font-family: "宋体";
font-size: 12px;
color: #000000;
text-decoration: none;
}
-->
</style>
<script language="JavaScript">
function isempty()
{
if(document.bitbus.destination.value=="")
{
alert("请输入目的地,嘿嘿");
return false;
}
}
</script></head><body>
<form action="index.aspx" method="post" name="bitbus" id="bitbus" onSubmit="return isempty();">
<table width="778" cellpadding="1" cellspacing="1" align="center">
<tr><td align="center" class="busNO">北京理工大学乘车路线查询</td></tr>
<tr><td class="busNO">
起点:
<select name="start">
<option value="魏公村西口">魏公村西口</option>
<option value="三义庙">三义庙</option>
<option value="农科院" selected>农科院</option>
</select>
终点:
<input name="destination" type="text" id="destination" maxlength="20">
<input type="submit" name="Submit" value="查询">
</td></tr>
</table></form>
<br/>
<%
If destination <> "" Then
search(start, destination)
End IF
%><br/>
<hr noshade size="1" style="border:1 dotted #FF9933" width="80%"/>
<center>
Copyright©<a href="http://btyz.51web.cn/" target="_blank">醉雨梧桐小站</a><br/>
Powered by <a href="mailto:[email protected]">醉雨梧桐</a><br/>
<%
endtime = Timer()
Response.Write("执行时间:" & (endtime - startime) * 1000 & "毫秒")
%></center>
</body>
</html>
<script language="vb" runat=server> Dim rs ' As ADODB.Recordset
Dim busNO ' As adodb.field
Dim route ' As Object
Dim s As Integer
Dim e As Integer
Dim temp As Integer
Dim route1 As String
Dim OutPut As String
Dim i As Integer
Dim start As String
Dim destination As String
Dim startime As Double
Dim endtime As Double
Function search(start, destination)
Dim conn ' As ADODB.Connection
Dim connstr As String
Dim db As String
db = "bus.mdb"
'连接数据库
On Error Resume Next
conn = new ADODB.Connection()
'connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"&Server.MapPath(""&db&"")&"';Jet OLEDB:DataBase PassWord='zhegebushishujuku'"
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & Server.MapPath("" & db & "") & "';'"
conn.Open(connstr)
On Error Resume Next
rs = conn.Execute("select busNO,route from bus where route like '%" & start & "%' and route like '%" & destination & "%'")
busNO = rs.Fields("busNO")
route = rs.Fields("route")
If rs.BOF AND rs.EOF Then
Response.Write("没有结果")
Else
Response.Write("<table cellpadding='1' cellspacing='1' width='778' align='center'>")
While Not rs.EOF
s = InStr(route.Value.Value.ToString(), start)
e = InStr(route.Value.Value.ToString(), destination)
If s > e Then
temp = s
s = e
e = temp
End IF
If s < 10 Then
s = 1
Else
s = s - 10
End IF
If Len(route.Value) - e < 10 Then
e = Len(route.Value)
Else
e = e + 10
End IF
route1 = Mid(route.Value, s, e - s)
route1 = Replace(route1, start, "<font color='FF0000'>" & start & "</font>", 1, 1, 1)
route1 = Replace(route1, destination, "<font color='FF0000'>" & destination & "</font>", 1, 1, 1)
OutPut = "<tr><td class='busNO'>公共汽车:" & busNO.Value & "</td></tr><tr><td>" & route1 & "</td></tr>"
Response.Write(OutPut)
rs.MoveNext()
i = i + 1
End While
Response.Write("<tr><td colspan='2' align='right'>" & start & "---" & destination & "共搜索到" & i & "个结果</td></td></table>")
End IF
rs = Nothing
conn = Nothing
End Function</script>
<%--
Generated by ASP2ASPX 3.1. Copyright 2002-2003 Netcoole.
ASP2ASPX home page: http://www.netcoole.com
Original File Name: D:\work\Sunshine\Web-Test\index.asp
--%><%@ Page language = "VB" codepage = 936 Debug="true"%><%
startime = Timer()
start = Request.Form("start")
destination = Request.Form("destination")
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>北京理工大学乘车路线查询</title>
<style type="text/css">
<!--
.busNO {
font-family: "宋体";
font-size: 16px;
text-decoration: none;
background-color: #FFFFFF;
text-align: center;
color: #000000;
}
table {
font-family: "宋体";
font-size: 12px;
text-decoration: none;
background-color: #FF9933;
}
tr {
font-family: "宋体";
font-size: 12px;
text-decoration: none;
background-color: #FFFFFF;
}
input {
font-family: "宋体";
font-size: 12px;
color: #FF9933;
text-decoration: none;
border: 1px solid #9933;
}
select {
font-family: "宋体";
font-size: 12px;
color: #FF9933;
text-decoration: none;
border: 1px solid FF9933;
background-color: #FFFFFF;
}
body {
font-family: "宋体";
font-size: 12px;
color: #000000;
text-decoration: none;
}
-->
</style>
<script language="JavaScript">
function isempty()
{
if(document.bitbus.destination.value=="")
{
alert("请输入目的地,嘿嘿");
return false;
}
}
</script></head><body>
<form action="index.aspx" method="post" name="bitbus" id="bitbus" onSubmit="return isempty();">
<table width="778" cellpadding="1" cellspacing="1" align="center">
<tr><td align="center" class="busNO">北京理工大学乘车路线查询</td></tr>
<tr><td class="busNO">
起点:
<select name="start">
<option value="魏公村西口">魏公村西口</option>
<option value="三义庙">三义庙</option>
<option value="农科院" selected>农科院</option>
</select>
终点:
<input name="destination" type="text" id="destination" maxlength="20">
<input type="submit" name="Submit" value="查询">
</td></tr>
</table></form>
<br/>
<%
If destination <> "" Then
search(start, destination)
End IF
%><br/>
<hr noshade size="1" style="border:1 dotted #FF9933" width="80%"/>
<center>
Copyright©<a href="http://btyz.51web.cn/" target="_blank">醉雨梧桐小站</a><br/>
Powered by <a href="mailto:[email protected]">醉雨梧桐</a><br/>
<%
endtime = Timer()
Response.Write("执行时间:" & (endtime - startime) * 1000 & "毫秒")
%></center>
</body>
</html>
<script language="vb" runat=server> Dim rs ' As ADODB.Recordset
Dim busNO ' As adodb.field
Dim route ' As Object
Dim s As Integer
Dim e As Integer
Dim temp As Integer
Dim route1 As String
Dim OutPut As String
Dim i As Integer
Dim start As String
Dim destination As String
Dim startime As Double
Dim endtime As Double
Function search(start, destination)
Dim conn ' As ADODB.Connection
Dim connstr As String
Dim db As String
db = "bus.mdb"
'连接数据库
On Error Resume Next
conn = new ADODB.Connection()
'connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"&Server.MapPath(""&db&"")&"';Jet OLEDB:DataBase PassWord='zhegebushishujuku'"
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & Server.MapPath("" & db & "") & "';'"
conn.Open(connstr)
On Error Resume Next
rs = conn.Execute("select busNO,route from bus where route like '%" & start & "%' and route like '%" & destination & "%'")
busNO = rs.Fields("busNO")
route = rs.Fields("route")
If rs.BOF AND rs.EOF Then
Response.Write("没有结果")
Else
Response.Write("<table cellpadding='1' cellspacing='1' width='778' align='center'>")
While Not rs.EOF
s = InStr(route.Value.Value.ToString(), start)
e = InStr(route.Value.Value.ToString(), destination)
If s > e Then
temp = s
s = e
e = temp
End IF
If s < 10 Then
s = 1
Else
s = s - 10
End IF
If Len(route.Value) - e < 10 Then
e = Len(route.Value)
Else
e = e + 10
End IF
route1 = Mid(route.Value, s, e - s)
route1 = Replace(route1, start, "<font color='FF0000'>" & start & "</font>", 1, 1, 1)
route1 = Replace(route1, destination, "<font color='FF0000'>" & destination & "</font>", 1, 1, 1)
OutPut = "<tr><td class='busNO'>公共汽车:" & busNO.Value & "</td></tr><tr><td>" & route1 & "</td></tr>"
Response.Write(OutPut)
rs.MoveNext()
i = i + 1
End While
Response.Write("<tr><td colspan='2' align='right'>" & start & "---" & destination & "共搜索到" & i & "个结果</td></td></table>")
End IF
rs = Nothing
conn = Nothing
End Function</script>
解决方案 »
- 有没有比较好的.NET页面打印技术?高手请推荐一个解决方案吧!
- repeater传参
- 急! 关于Image Caching 问题
- ASPX页面打开模式窗口的奇怪问题——信息没有及时更新
- datalist 无记录返回一条提示。
- asp.net中如何定义一个session数组呀?
- 在用户控间中能访问宿主页面中的对象吗?比如说访问一个宿主页面的textbox
- ISMP消息订购通知的问题
- 怎么从用户控件向父页面传递参数
- 如何vs2003 asp.net中通过快捷键来切换设计视图和查看代码二种模式呢?我找了好久。。。
- request.querystring("")能传数组吗?
- 我想请问各位高手,如何在ASP.NET中实现在两个Frame中添加一个按钮实现隐藏功能?
<%
''asp代码
%>
OleDbDataAdapter cmd = new OleDbDataAdapter("select busNO, route from bus where route like '%" + start + "%' and route like '%" + destination + "%'", conn);
DataSet ds = new DataSet();
cmd.Fill(ds, "bus");
string strHtml = "";
if(ds.Tables["bus"].Rows.Count == 0)
{
strHtml = "没有结果";
}
else
{
strHtml += "<table cellpadding='1' align=center>";
int temp = -1;
for(int i = 0; i < ds.Tables["bus"].Rows.Count ; i++)
{
int s = route.IndexOf(start);
int e = route.IndexOf(destination);if(s > 3)
{
temp = s;
s = e;
e = temp;
}
if(s < 10)
s = 1;
else
s -= 10;
...
.....
....
.....
}
}