A
Aries
Hi all
I have a program looks like this.
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<html>
<script Language="C#" runat="server">
StreamReader din =
File.OpenText("C:\\Inetpub\\wwwroot\\main\\deployment\\test\\version.txt");
String str;
str = din.ReadLine();
</script>
<body>
<h1>testing</h1>
Text in file <asp:label id="str" font-size="24" font-bold="true"
runat=server/>
</body>
</html>
I get an error message:
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or
interface member declaration
But if I do something like this
<script Language="C#" runat="server">
void Page_Load(Object source, EventArgs e) {
StreamReader din =
File.OpenText("C:\\Inetpub\\wwwroot\\main\\Deployment\\test\\version2.txt");
String str;
str = din.ReadLine();
}
</script>
I got no error message but the str doesn't give me anything.
Can some one please help me out on how to fix the problem? There is only 1
line in the version.txt. Version.txt has something like "2.5.1" (there is
quote in it).
thanks.
ÁÙ§Ú¥»¦â
Forever Bad.
I have a program looks like this.
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<html>
<script Language="C#" runat="server">
StreamReader din =
File.OpenText("C:\\Inetpub\\wwwroot\\main\\deployment\\test\\version.txt");
String str;
str = din.ReadLine();
</script>
<body>
<h1>testing</h1>
Text in file <asp:label id="str" font-size="24" font-bold="true"
runat=server/>
</body>
</html>
I get an error message:
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or
interface member declaration
But if I do something like this
<script Language="C#" runat="server">
void Page_Load(Object source, EventArgs e) {
StreamReader din =
File.OpenText("C:\\Inetpub\\wwwroot\\main\\Deployment\\test\\version2.txt");
String str;
str = din.ReadLine();
}
</script>
I got no error message but the str doesn't give me anything.
Can some one please help me out on how to fix the problem? There is only 1
line in the version.txt. Version.txt has something like "2.5.1" (there is
quote in it).
thanks.
ÁÙ§Ú¥»¦â
Forever Bad.