01.
<%@ Page Language=
"C#"
%>
02.
<script runat=
"server"
>
03.
04.
void
Page_Load(Object sender, EventArgs e)
05.
{
06.
String strString =
"I Love ThaiCreate.Com Version 2009"
;
07.
this
.lblText1.Text = strString.Substring(7,14);
08.
this
.lblText2.Text = Left(strString,6);
09.
this
.lblText3.Text = Right(strString,4);
10.
this
.lblText4.Text = Mid(strString,7,14);
11.
this
.lblText5.Text = Mid(strString,6);
12.
}
13.
14.
public
String Left(String Param,
int
Length)
15.
{
16.
String Result = Param.Substring(0, Length);
17.
return
Result;
18.
}
19.
20.
public
String Right(String Param,
int
Length)
21.
{
22.
String Result = Param.Substring(Param.Length - Length, Length);
23.
return
Result;
24.
}
25.
26.
public
String Mid(String Param,
int
StartIndex,
int
Length)
27.
{
28.
String Result = Param.Substring(StartIndex, Length);
29.
return
Result;
30.
}
31.
32.
public
String Mid(String Param,
int
StartIndex)
33.
{
34.
String Result = Param.Substring(StartIndex);
35.
return
Result;
36.
}
37.
38.
</script>
39.
<html>
40.
<head>
41.
</head>
42.
<body>
43.
<form runat=
"server"
>
44.
<asp:Label id=
"lblText1"
runat=
"server"
></asp:Label><br />
45.
<asp:Label id=
"lblText2"
runat=
"server"
></asp:Label><br />
46.
<asp:Label id=
"lblText3"
runat=
"server"
></asp:Label><br />
47.
<asp:Label id=
"lblText4"
runat=
"server"
></asp:Label><br />
48.
<asp:Label id=
"lblText5"
runat=
"server"
></asp:Label><br />
49.
</form>
50.
</body>
51.
</html>