Asp.net c # dynamically read the drive lamp code

Source: Internet
Author: User

Front-end html and js scripts:

 

[Html]
<Div>
<Table border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<Td bgcolor = "# CC66FF"
Style = "WIDTH: 990px; HEIGHT: 5px; BACKGROUND-COLOR: # ffffff; text-align: center;">
</Td>
</Tr>
<Tr>
<Td style = "BORDER-RIGHT: # cccc99 1px solid; BORDER-TOP: # cccc99 1px solid; BORDER-LEFT: # cccc99 1px solid; WIDTH: 990px; BORDER-BOTTOM: # cccc99 1px solid ">
<Table border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<Td style = "WIDTH: 990px; BACKGROUND-COLOR: # ffffff">
<Div style = "WIDTH: 990px; HEIGHT: 139px">
<Div id = "demo"
Style = "PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 100%; COLOR: # ffffff; PADDING-TOP: 0px ">
<Table align = "left" border = "0" cellpadding = "0" cellspace = "0" cellspacing = "0"
Style = "WIDTH: 900px; HEIGHT: 139px">
<Tr>
<Td id = "demo1" valign = "top">
<Table border = "0" cellpadding = "0" cellspacing = "0" width = "2000">
<Tr> <asp: Label ID = "Label1" runat = "server" Text = "Label"> </asp: Label>
</Tr>

</Table>
</Td>
<Td id = "demo2" valign = "top">
</Td>
</Tr>
</Table>
</Div>
<SCRIPT _ designer: dtid = "3377854339350821">
Var speed3 = 1 // The greater the speed, the slower the speed.
Demo2.innerHTML = demo1.innerHTML
Function Marquee (){
If (demo2.offsetWidth-demo. scrollLeft <= 0)
Demo. scrollLeft-= demo1.offsetWidth
Else {
Demo. scrollLeft ++
}
}
Var MyMar = setInterval (Marquee, speed3)
Demo. onmouseover = function () {clearInterval (MyMar )}
Demo. onmouseout = function () {MyMar = setInterval (Marquee, speed3 )}
</SCRIPT>
</Div>
</Td>
</Tr>
</Table>
</Td>
</Tr>
<Tr>
<Td style = "WIDTH: 100px; HEIGHT: 5px">
</Td>
</Tr>
</Table>
</Div>

 

Code on the cs page:

[Csharp]
Dal_Collection dc = new dal_Collection ();
Label1.Text = dc. GetIndexZouMaDeng ();
 

Dal_Collection.GetIndexZouMaDeng () code:

[Csharp]
<P> using System. Text; </p>
[Csharp] view plaincopy

[Csharp] view plaincopy
Public string GetIndexZouMaDeng ()
{
 
StringBuilder res = new StringBuilder ();
DataTable dt0 = GetNewsPageDB ("select top 10 CN_Id, CN_Title, CN_Intro, CN_Url, CN_Uid, CN_Times from Collection order by CN_Times desc ");
If (dt0.Rows. Count = 0)
{
Res. Append ("no relevant data! ");
}
Else
{
For (int I = 0; I <dt0.Rows. Count; I ++) // see [NOTE 1]
{
Res. append ("<td align = \" center \ "height = \" 139 \ "width = \" 184 \ "> </td> ");
 
}
If (dt0.Rows. Count <= 6)
{
Res. Append (res. ToString ());
}
}
 
Return res. ToString ();
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.