For I = 0 To rs.Fields.Count-1
Response.write rs(I).Name
Nextrs(I).Name 讀取第I欄的欄位名稱
分享 ASP,ASP.NET,VB,C#,程式開發,網站設計,部落格,微網誌,網路行銷,facebook 行銷,噗浪行銷,社群行銷,電腦硬體軟體,網路賺錢等資訊內容。『噗落格』裡的文章大多是從各網站摘錄(轉貼)下來的,僅提供研究及筆記之用途,如有侵權請留言告知!一開始不打算賺錢,一個不可能中的可能
For I = 0 To rs.Fields.Count-1
Response.write rs(I).Name
Next<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridviewAutoPage.aspx.cs"
Inherits="GridviewAutoPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>GridviewAutoPage</title>
<meta http-equiv="Page-Enter" content="blendTrans(duration=1)" />
<meta http-equiv="Page-Exit" content="blendTrans(duration=1)" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="1">
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
</div>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
</form>
</body>
</html>using ...System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class GridviewAutoPage : System.Web.UI.Page
...{
protected void Page_Load(object sender, EventArgs e)
...{
if (!IsPostBack)
...{
LoadData();
}
}
protected void LoadData()
...{
this.GridView1.DataSource = new string[] ...{ "Dotblogs", "F6 Team", "puma" };
this.GridView1.DataBind();
}
protected void Timer1_Tick(object sender, EventArgs e)
...{
if (this.GridView1.PageCount > 1)
...{
if (this.GridView1.PageIndex == this.GridView1.PageCount - 1)
...{
this.GridView1.PageIndex = 0;
LoadData();
}
else
...{
this.GridView1.PageIndex = this.GridView1.PageIndex + 1;
LoadData();
}
}
}
}
<meta http-equiv="refresh" content="10; url=http://www.dotblogs.com.tw/puma/" /> HtmlMeta meta = new HtmlMeta();
meta.Attributes.Add("http-equiv", "refresh");
meta.Content = "10; url=http://www.dotblogs.com.tw/puma/";
this.Header.Controls.Add(meta);
@echo off
:try1
copy xxx.zip z:\tools\xxx.zip
if errorlevel 1 goto try2
echo File was copied to [Z] successfully.
goto end
:try2
copy xxx.zip x:\tools\xxx.zip
if errorlevel 1 goto try3
echo File was copied to [X] successfully.
goto end
:try3
copy xxx.zip y:\tools\xxx.zip
if errorlevel 1 goto error
echo File was copied to [Y] successfully.
goto end
:error
echo Error happened.
goto end
:end
echo End.