Documente Academic
Documente Profesional
Documente Cultură
"
# $ %& #
' ()
$ %& $ $ %&
+
, ! $ %& -."
'
,
/
$ %&
$ %& ,
0
$ %&
$ %&
+
12
0
3 4 5
+ +
' +
3 5 5
&3* + $ 6
789
:.; .
4 $ +
< = + 0
<
4 ) 0
= 4 *
'
{
SqlConnection cn = new SqlConnection(s);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(selstr, cn);
da.Fill(ds);
return ds;
}
% = 4
= + # +
<
= 4 = +
+ 0 +
= 4
0 # >, *
, $ %& -.
, $
' $ %&
?
' ' @$
&3*
< 7
( 8
runat="server" />
0 *
! "#
%
@ 3
! " 3
7
$ ( 8
< # >, *
Button1.Text = Message.Value;
0
3 *
"
#
,
,
, *
3
! A "
! "
&3 5
B(#
,
, ? ' 3
!
' ? $$) !
$ $ ) "
"
0 3 $
3
"
# $
C $ <
C $
C $
$ , 3
3 2
= ,
<script language="javascript">
function SetCookie(cName, cValue, expDays) {
var today = new Date();
var expire = new Date();
if (exDays == null || expDays == 0)
expDays = 4;
expire.setTime(today.getTime() + 3600000 * 24 * expDays);
document.cookie = cName + "=" + escape(cValue)
+ ";expires=" + expire.toGMTString();
}
</script>
function GetCookie(cName) {
if (document.cookie.length > 0) {
startIndex = document.cookie.indexOf(cName + "=");
if (startIndex != -1) {
startIndex =startIndex + cName.length + 1;
endIndex = document.cookie.indexOf(";", startIndex);
if (endIndex == -1) endIndex = document.cookie.length;
return unescape(document.cookie.substring(startIndex,
endIndex));
}
}
return "";
}
<body>
<form id="form1" runat="server">
<div>
<script language="javascript">
SetCookie("mycookie", "hello", 3);
</script>
<button id="btn1" onclick="f1()"></button>
</div>
</form>
</body>
</html>
*
function f1() {
form1.btn1.value = GetCookie("mycookie");
}
C $
" %
< $ %& *
D E ,
D ' , %&
$ E ,
<
3 3 3 3
# >, *
$
>) *
if (Request.Cookies["user"] != null)
Label1.Text = Request.Cookies["user"].Value;
else
Label1.Text = "Guest";
" %
3 !
3 "<
3
HttpCookie x = new HttpCookie("user");
x.Value = TextBox1.Text;
x.Expires = DateTime.Now.AddDays(2); //expires in 2 days
Response.Cookies.Add(x);
3 3 FE ( ?
< <
3 G.
3
$HD'
#
F< ( ? 0
3
3
$ <
)* (
3 4 3
0
1
E !
E 6
7 3# 3B8
9"; 3 3
! "
E E !
7 3I :8
K 3# 3B 3"
;
! "
) # 3B 3:E 6
789
;
' E E 3 !"
0
E E !" 3
E
345 !
$ %& $ %&
%& 4 ,)E
$ %& 4
4 3
3
D
$ 3
$ %&
$ %& $
0
< 4
3
4
# $ %& -.
&3* 6738
9:B.;
6
7 89
: ;
$ 6
789:B;! "
$
$
? $
<
$
# $
!
! 4 "
4 $ , *
$
,
$
,
4
< 3
%
,
$
,
$
, 3
&3*$ *
,
<
D
$
$ *
#
$ $
= 3 $
3 '
= 3 +$
= 3 $ %& D %
3 = 3
3 = 3
= 3
$ *
B >$ *
< %
5
- >& *
< $ %&
J >& *
0
>&
2 $ >$ *
0 $ >$
G $ >& *
<
0 $ > !
"
<
D D @ D
' D
@ D
$
$ >$ B
$ @ D
$ >& 0
= 3
}
% >) *
' >)
$ >)
0 L M *
<system.web>
<sessionState timeout="5"></sessionState>
....
</system.web>
$ !
"
#
$ %&
?
$ %& $ $
D $/)$ ! "
3* ' !
' '
3
$ %& *
= $ !, $ "
$ $ %& $ $ $
= @
L $ M
&3*
<sessionState mode="StateServer"
stateConnectionString="104.323.203.2" ..... >
</sessionState>
0 $ %& $/)$
> 3
%&
*
B (
- 4 5 5 $
? 5