Nessun risultato. Prova con un altro termine.
Guide
Notizie
Software
Tutorial

Scacchiera in VB.NET

Grazie al seguente script, è possibile disegnare una scacchiera sfruttando la tecnologia vb.net.

<% @page language="VB" %>
<script runat="server">
sub page_load(obj as object, e as eventargs)
dim strTavolo as string
strTavolo= chr(13) + chr(10)
strTavolo=strTavolo + " <table width=""160"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
strTavolo= strTavolo + chr(13) + chr(10)
dim strFondo as string=""
dim intVolta as integer=1
dim ctInd as integer
dim ctInd2 as integer
for ctInd=1 to 8 step 1
if(intVolta=1) then
intVolta=2
strFondo="#00FF99"
else
intVolta=1
strFondo="#FF0000"
end if
strTavolo=strTavolo + chr(13) + chr(10)
strTavolo=strTavolo + " <tr>"
strTavolo=strTavolo + chr(13) + chr(10)
for ctInd2= 1 to 8 step 1
strTavolo=strTavolo+" <td width=""20"" height=""20"" bgcolor="""+strFondo+"""> </td>"
strTavolo=strTavolo + chr(13) + chr(10)
if(strFondo="#00FF99") then
strFondo="#FF0000"
else
strFondo="#00FF99"
end if
next ctInd2
strTavolo=strTavolo + " </tr>"
strTavolo=strTavolo + chr(13) + chr(10)
next ctInd
strTavolo=strTavolo + " </table>"
tavolo.text = strTavolo + chr(13) + chr(10)
end sub
</script>
<asp:label value="" id="tavolo" runat="server"/>


I caratteri chr(13) + chr(10) servono per formattare in modo opportuno il codice prodotto in uscita
Grazie al seguente script, è possibile disegnare una scacchiera sfruttando la tecnologia vb.net.

<% @page language="VB" %>
<script runat="server">
sub page_load(obj as object, e as eventargs)
dim strTavolo as string
strTavolo= chr(13) + chr(10)
strTavolo=strTavolo + " <table width=""160"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
strTavolo= strTavolo + chr(13) + chr(10)
dim strFondo as string=""
dim intVolta as integer=1
dim ctInd as integer
dim ctInd2 as integer
for ctInd=1 to 8 step 1
if(intVolta=1) then
intVolta=2
strFondo="#00FF99"
else
intVolta=1
strFondo="#FF0000"
end if
strTavolo=strTavolo + chr(13) + chr(10)
strTavolo=strTavolo + " <tr>"
strTavolo=strTavolo + chr(13) + chr(10)
for ctInd2= 1 to 8 step 1
strTavolo=strTavolo+" <td width=""20"" height=""20"" bgcolor="""+strFondo+"""> </td>"
strTavolo=strTavolo + chr(13) + chr(10)
if(strFondo="#00FF99") then
strFondo="#FF0000"
else
strFondo="#00FF99"
end if
next ctInd2
strTavolo=strTavolo + " </tr>"
strTavolo=strTavolo + chr(13) + chr(10)
next ctInd
strTavolo=strTavolo + " </table>"
tavolo.text = strTavolo + chr(13) + chr(10)
end sub
</script>
<asp:label value="" id="tavolo" runat="server"/>


I caratteri chr(13) + chr(10) servono per formattare in modo opportuno il codice prodotto in uscita
Link copiato negli appunti

Grazie al seguente script, è possibile disegnare una scacchiera sfruttando la tecnologia vb.net.

<% @page language="VB" %>

<script runat="server">

sub page_load(obj as object, e as eventargs)

dim strTavolo as string

strTavolo= chr(13) + chr(10)

strTavolo=strTavolo + " <table width=""160"" border=""0"" cellspacing=""0"" cellpadding=""0"">"

strTavolo= strTavolo + chr(13) + chr(10)

dim strFondo as string=""

dim intVolta as integer=1

dim ctInd as integer

dim ctInd2 as integer

for ctInd=1 to 8 step 1

if(intVolta=1) then

intVolta=2

strFondo="#00FF99"

else

intVolta=1

strFondo="#FF0000"

end if

strTavolo=strTavolo + chr(13) + chr(10)

strTavolo=strTavolo + " <tr>"

strTavolo=strTavolo + chr(13) + chr(10)

for ctInd2= 1 to 8 step 1

strTavolo=strTavolo+" <td width=""20"" height=""20"" bgcolor="""+strFondo+"""> </td>"

strTavolo=strTavolo + chr(13) + chr(10)

if(strFondo="#00FF99") then

strFondo="#FF0000"

else

strFondo="#00FF99"

end if

next ctInd2

strTavolo=strTavolo + " </tr>"

strTavolo=strTavolo + chr(13) + chr(10)

next ctInd

strTavolo=strTavolo + " </table>"

tavolo.text = strTavolo + chr(13) + chr(10)

end sub

</script>

<asp:label value="" id="tavolo" runat="server"/>

I caratteri chr(13) + chr(10) servono per formattare in modo opportuno il codice prodotto in uscita