<%@ Page Language="C#" %>
<html>
<head>
<title>C# Primer: Variables</title>
<link rel="stylesheet" href="/shared/netdemos.css">
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>C# Primer: <span class="hilite">Variables</span></h2></div>
<hr size=1 width=92%>
<blockquote>
<h5>String Manipulation</h5>
<% string strVar = "concatenating"; %>
<p>This is an example of <%= strVar + " strings." %></p>
<h5>Integer Manipulation</h5>
<% int intVar = 5; %>
<p><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></p>
<h5>Date and Time</h5>
<% DateTime today = DateTime.Now; %>
<p>Today is <%= today.ToString ( "f" ) %>.
<h5>Boolean Manipulation</h5>
<% bool isBefore5 = ( DateTime.Now.Hour < 17 );
// Output message based on value.
if ( isBefore5 ) {
Response.Write ( "<p>Good day." );
}
else {
Response.Write ( "<p>Good evening." );
} %>
</blockquote>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>