摘要:
在ItemCreate 事件中加入以下代码: private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if ( e.Item.ItemType == ListItemType.Header ) { Tabl... 阅读全文
摘要:
TextBox txt = new TextBox(); txt.ID="Text1"; txt.Width=250; txt.Text="這是動態使用程式新增的TextBox!"; ((HtmlForm )Page.FindControl("Form1")).Controls.Add(txt); txt.ForeColor=Color.FromName("Gr... 阅读全文
摘要:
步驟: 1. 引用System.Security.Principal命名空间 using System.Security.Principal; 2.代码 WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent()); wp.Identity.... 阅读全文