我正在尝试获取一个文件,该文件具有要由 htmnl 读取的服务器名称(使用 ac# 脚本进行读取),但我无法让脚本将名称传递给 html,这是代码:
<%@ Page Language="C#" MasterPageFile="~/MasterPage3.master" Title="Services" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<center>
<script runat="server">
string[] server = new string[] { };
void Button1_Click(Object sender, EventArgs e)
{
string[] server = System.IO.File.ReadAllLines(@"C:\server.txt"); //here i get the name of the server
return server[1];
}
</script>
<br />
<table width="600px" style="border-color: Silver; border-style: solid; border: 1">
<tr>
<td style="background-color: LightBlue; text-align: center">
<a href="Default.aspx?SERVER=1">1</a>
</td>
</tr>
<tr>
<td style="background-color: LightBlue; text-align: center">
<a href="Default.aspx?SERVER=2">2</a>
</td>
</tr>
<tr>
<td style="background-color: LightBlue; text-align: center">
<a href='Default.aspx?SERVER=' <%#server[1]%>>JD5PKF1</a>
</td>
//but i cant get it to be read here
</tr>
<input type="button" value="All in one" onclick="location.href='Option2.aspx';">
</table>
</center>
</asp:Content>
有任何想法吗?